J
JBalkan
I hope you can help me. I am using Access 2000. I am trying to assign a
number to a record in a form that starts with GO1, increments by 1 and then
ends with a CountyID. The CountyID is a field on the form that the user will
fill out.
For example:
Record 1 would be: G01234K. "K" is the CountyID.
Record 2 might be: G01235C "C" is the CountyID for this record.
Record 3 might be: G01236K
Record 4 might be: G01237A
The CountyID depends upon the user's input.
I went to Office Online and found a very helpful page called "incrementing
the numeric portion of a string in Access." It gave me the exact code to
write in the AfterUpdate event procedure.
Dim strMax As String
strMax = DMax("fldCount", "tblCount")
Me!HiddenCtl = "Cust-" & Right(strMax, Len(strMax) - InStr(1, strMax,
"-")) + 1
I followed the instructions and it worked for incrementing the record.
Unfortunately, I don't understand programming and can't figure out where to
put the [CountyID] field in the above string.
number to a record in a form that starts with GO1, increments by 1 and then
ends with a CountyID. The CountyID is a field on the form that the user will
fill out.
For example:
Record 1 would be: G01234K. "K" is the CountyID.
Record 2 might be: G01235C "C" is the CountyID for this record.
Record 3 might be: G01236K
Record 4 might be: G01237A
The CountyID depends upon the user's input.
I went to Office Online and found a very helpful page called "incrementing
the numeric portion of a string in Access." It gave me the exact code to
write in the AfterUpdate event procedure.
Dim strMax As String
strMax = DMax("fldCount", "tblCount")
Me!HiddenCtl = "Cust-" & Right(strMax, Len(strMax) - InStr(1, strMax,
"-")) + 1
I followed the instructions and it worked for incrementing the record.
Unfortunately, I don't understand programming and can't figure out where to
put the [CountyID] field in the above string.