hardhitter06
Registered User.
- Local time
- Today, 06:18
- Joined
- Dec 21, 2006
- Messages
- 600
I have this code that increases a contract number by 1 for every new record under the "MU" category. What I need it to do is start counting from the current MUs in the database since I converted this over along with the old files. So I need it to start counting from the current one which is around 300. I had help with writing this code since I'm new to the game so how wquld I go about making this small change?
Private Sub Category_AfterUpdate()
Dim MUcounter As Long
If Not IsNumeric([Forms]![frmContract(input)]![frmSubfrm]![Contract #]) Then
MUcounter = Right([Forms]![frmContract(input)]![frmSubfrm]![Contract #], 4)
Else
MUcounter = [Forms]![frmContract(input)]![frmSubfrm]![Contract #]
End If
MUcounter = MUcounter + 1
If Me!Category = 7 Then
Me![Contract #] = "MU" & Format(MUcounter, "0000")
Else
Me![Contract #] = InputBox("Enter Contract Number")
End If
Thanks for your help.
Private Sub Category_AfterUpdate()
Dim MUcounter As Long
If Not IsNumeric([Forms]![frmContract(input)]![frmSubfrm]![Contract #]) Then
MUcounter = Right([Forms]![frmContract(input)]![frmSubfrm]![Contract #], 4)
Else
MUcounter = [Forms]![frmContract(input)]![frmSubfrm]![Contract #]
End If
MUcounter = MUcounter + 1
If Me!Category = 7 Then
Me![Contract #] = "MU" & Format(MUcounter, "0000")
Else
Me![Contract #] = InputBox("Enter Contract Number")
End If
Thanks for your help.