Hi,
I've been trying to write some code to increase a field value by 1 each time a command button on my form is clicked.
Basically my company uses "Job Numbers" for every order they get, if the job is based in woking the number will be WWO-0001 and if it's based at Gatwick then the number will be GWO-0001. I want the command button to look up the last job number used and increment it by 1, unfortunately im not sure how to go about this. At the moment im using this code with a combo box.:
Private Sub JobLocation_AfterUpdate()
If JobLocation = "Gatwick" Then
Me!JobNo = "GWO-"
Else
Me!JobNo = "WWO-"
End If
End Sub
The problem with this is that the user has to enter the actual number part themselves. I created a command button which displays a list of the Job numbers from the site selected, however my manager is still not satisfied. Can anyone help me out?
Cheers,
Marc.
I've been trying to write some code to increase a field value by 1 each time a command button on my form is clicked.
Basically my company uses "Job Numbers" for every order they get, if the job is based in woking the number will be WWO-0001 and if it's based at Gatwick then the number will be GWO-0001. I want the command button to look up the last job number used and increment it by 1, unfortunately im not sure how to go about this. At the moment im using this code with a combo box.:
Private Sub JobLocation_AfterUpdate()
If JobLocation = "Gatwick" Then
Me!JobNo = "GWO-"
Else
Me!JobNo = "WWO-"
End If
End Sub
The problem with this is that the user has to enter the actual number part themselves. I created a command button which displays a list of the Job numbers from the site selected, however my manager is still not satisfied. Can anyone help me out?
Cheers,
Marc.