jtbrown1955
Registered User.
- Local time
- Today, 01:12
- Joined
- May 28, 2005
- Messages
- 17
I am using Access 2003
Say I have 3 people in my data base. As they become eligible for a badge, I give them a badge number. The badge numbers are sequential, but the dates for eligibility are not. By that I mean, Bill may be the first applicant, but the third person to get a badge. How can I automatically give Sam a badge number of 1000 and Bill 1003? Obviously my database is larger than 3 people. I enter the personnel as the requests come in. I issue badge numbers as they are approved. What I am doing now is simply looking up the last badge number and giving the next one to the next approved applicant. Remember, the badge numbers are not simply given to the next applicant in order of their place in the data base. The cell for the badge number is left blank till that person is approved. I found an example that might work, but I don't know how to use it. I put the code in an event for when I double click on the cell in the form. When I substitute my cell names and table names for the example, I get a debug error saying Me!OrderCtl cannot be found. Order is my cell name, Operator Information is the table. Please help me and thank you. Also, this may not be the best way to handle this so any suggestions will be helpful.
Private Sub Text48_DblClick(Cancel As Integer)
Dim strMax As String
strMax = DMax("Order", "Operator Information")
Me!OrderCtl = "REC-" & Right(strMax, _
Len(strMax) - _
InStr(1, strMax, "-")) + 1
End Sub
Say I have 3 people in my data base. As they become eligible for a badge, I give them a badge number. The badge numbers are sequential, but the dates for eligibility are not. By that I mean, Bill may be the first applicant, but the third person to get a badge. How can I automatically give Sam a badge number of 1000 and Bill 1003? Obviously my database is larger than 3 people. I enter the personnel as the requests come in. I issue badge numbers as they are approved. What I am doing now is simply looking up the last badge number and giving the next one to the next approved applicant. Remember, the badge numbers are not simply given to the next applicant in order of their place in the data base. The cell for the badge number is left blank till that person is approved. I found an example that might work, but I don't know how to use it. I put the code in an event for when I double click on the cell in the form. When I substitute my cell names and table names for the example, I get a debug error saying Me!OrderCtl cannot be found. Order is my cell name, Operator Information is the table. Please help me and thank you. Also, this may not be the best way to handle this so any suggestions will be helpful.
Private Sub Text48_DblClick(Cancel As Integer)
Dim strMax As String
strMax = DMax("Order", "Operator Information")
Me!OrderCtl = "REC-" & Right(strMax, _
Len(strMax) - _
InStr(1, strMax, "-")) + 1
End Sub