BarefootPaul
Board Regular
- Joined
- Jul 21, 2011
- Messages
- 54
I have a table that is updated by a userform with a variety of combo boxes and text boxes. One of the fields in the table is a unique ID (sIRID) based on what the user enters in the userform. It is possible for there to be identical information entered into the userform and thus create identical sIRID's. I want to have the first one be appended with an "a", the second with a "b", etc.
I have tried putting together some things with only limited success.
This will be part of a larger module that updates the table when a user clicks a cmd button. I am learning VBA as I go, so any help is greatly appreciated.
I have tried putting together some things with only limited success.
Code:
sIRID = Left(txtFName.Value, 1) & Left(txtLName.Value, 1) & _
"IR" & sProgram & sDOI & "a"
'Insert search for sIRID in column F
If 'cell in column F' = sIRID Then
sIRID = Left(sIRID, 14) & "b"
ElseIf 'Code' = sIRID Then
sIRID = Left(sIRID, 14) & "b"
Etc, Etc, Etc... (Sorry, I watched the original "The King and I" last night)
This will be part of a larger module that updates the table when a user clicks a cmd button. I am learning VBA as I go, so any help is greatly appreciated.