Advance Data Access Pages

Yobi4ever

Registered User.
Local time
Today, 08:43
Joined
Feb 2, 2006
Messages
14
I have a table with three fields:

AutoID : AutoNumber
Name: Text
RecordID: Number "Long Integer"

I have created a form that aytomatically starts a new record and I have also
placed the following Code in the form's module:

Private Sub Form_Current()
' Comments: If this is the first entry then set the RequestID to 1,
' else find the maximum RequestID and add 1 to it.

If Not IsNull(DMax("[RequestID]", "tblMain")) Then
Me.RequestID = DMax("[RequestID]", "tblMain") + 1
Else
Me.RequestID = 1
End If

End Sub


I have saved the form as a Data Access page but the code doesn't work and
I couldn't find a code simialr to that which I can use in my html page?!
Maybe I can use ADO to open a recordset ans search for the maximum value
but I don't know the exact code and how to write the result back to the
recordID field in the html page?

Thank you.
 
AFAIK, VBA doesn't work in DAP. You could try creating a simple DAP page, then using VBScript do do what you want. However, DAP isn't very advanced at all, and unless this is in an intranet environment, I would suggest you use something else for your form.
 
Thanks!
I'm using it for my Intranet. Can you please tell me the best place to look for the VBScript that would have a similar formula?


Thank you.
 

Users who are viewing this thread

Back
Top Bottom