Rosario
Posts: 54
|
Posted: 01/15/2009, 12:35 AM |
|
I have a MSSQL DB back end and my incremential uniq id is just plain old ID in the table, my other unique identifier is the user called ATTUID. I tried aplying this logic DB name is MSOC and the table name is JOBAID1
LastInsertID = CType((New ID("", Insert.Dao.ExecuteScalar("SELECT
MAX(CRMID) FROM Individuals WHERE Name=" & ATTUID & " ))).Value, Int64)
That didnt work
In plain english I need to:
Let user create a new record, insert that as normal.
Then (AfterInsert) you reget the last inserted record ID and call the
form with that ID which will present that to the user in editmode.
Any Help here would be great!
|
|
|
Rosario
Posts: 54
|
Posted: 01/15/2009, 6:33 AM |
|
Also using the code from the example pack gave no result to the next page
'Custom Code @17-73254650
' -------------------------
Dim LastID
'Retrieve the last inserted key if a new user is registered
'This method of retrieving the last inserted key is safe because the value of the user_login field has to be unique.
If IsEmpty(Request.QueryString("ID")) Then
LastID = CCDLookup("max(ID)","JOBAID1","ATTUID="&DBMSOC.ToSQL(Request.Form("ATTUID"),"CCText"),DBMSOC)
If InStr(Redirect,"?") = 0 Then
Redirect = Redirect & "?ID=" & LastID
ElseIf Right(Redirect, 1) = "?" Then
Redirect = Redirect & "ID=" & LastID
Else
Redirect = Redirect & "&ID=" & LastID
End If
End IF
'End Custom Code' -------------------------
Dose this look right?
|
|
|
|