K
Kari
I have the following code running behind a button on a
regular Access form:
Set cnn = Access.CurrentProject.Connection
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseServer
rst.Open "sWONbr", cnn, adOpenDynamic,
adLockOptimistic
rst.MoveFirst
Do Until rst.EOF
If IsNull(Forms!frmMarketingWO_Add!RequestorNbr)
Or Forms!frmMarketingWO_Add!RequestorNbr = 0 Then
rst!RQNbr = rst!RQNbr + 1
Forms!frmMarketingWO_Add!RequestorNbr = rst!
RQNbr
rst.Update
End If
rst.MoveNext
Loop
I would like to save this form as a data access page but
how do I modify this code to work on the new data access
page. The purpose of the code is to open a table which
contains one record which increments by one each time a
new record is added another table (it is the primary key
of the table).
regular Access form:
Set cnn = Access.CurrentProject.Connection
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseServer
rst.Open "sWONbr", cnn, adOpenDynamic,
adLockOptimistic
rst.MoveFirst
Do Until rst.EOF
If IsNull(Forms!frmMarketingWO_Add!RequestorNbr)
Or Forms!frmMarketingWO_Add!RequestorNbr = 0 Then
rst!RQNbr = rst!RQNbr + 1
Forms!frmMarketingWO_Add!RequestorNbr = rst!
RQNbr
rst.Update
End If
rst.MoveNext
Loop
I would like to save this form as a data access page but
how do I modify this code to work on the new data access
page. The purpose of the code is to open a table which
contains one record which increments by one each time a
new record is added another table (it is the primary key
of the table).