A
a24t42
I am having problem adapting the multiuser counter code. I have a form
called Regulator. What I want is to look up the counter in a table
called Counter and set the control ID on the form to the counter. I
keep getting an error. Any help would be apprecaited. Here is the code
I have on a command button -
Private Sub cmdSave_Click()
Dim db As Database
Dim rs As Recordset
Dim NextNumber As Long
Dim ID As Long
Dim testmsg As Integer
Dim Code As String
Set db = OpenDatabase("D:\SouthEastern\STC_Stock\STC_Stock.mdb")
Set rs = db.OpenRecordset("Counter", dbOpenDynaset)
Me!ID = rs!NextNumber
Me!Code = "3PD"
rs.Edit
rs!NextNumber = rs!NextNumber + 1
rs.Update
testmsg = MsgBox("Do you want to add another Record?", 4, "Question?")
If testmsg = 6 Then
DoCmd.GoToRecord , , acNewRec
Else
DoCmd.Close
End If
End Sub
Thanks in advance.
called Regulator. What I want is to look up the counter in a table
called Counter and set the control ID on the form to the counter. I
keep getting an error. Any help would be apprecaited. Here is the code
I have on a command button -
Private Sub cmdSave_Click()
Dim db As Database
Dim rs As Recordset
Dim NextNumber As Long
Dim ID As Long
Dim testmsg As Integer
Dim Code As String
Set db = OpenDatabase("D:\SouthEastern\STC_Stock\STC_Stock.mdb")
Set rs = db.OpenRecordset("Counter", dbOpenDynaset)
Me!ID = rs!NextNumber
Me!Code = "3PD"
rs.Edit
rs!NextNumber = rs!NextNumber + 1
rs.Update
testmsg = MsgBox("Do you want to add another Record?", 4, "Question?")
If testmsg = 6 Then
DoCmd.GoToRecord , , acNewRec
Else
DoCmd.Close
End If
End Sub
Thanks in advance.