Sabotage
Board Regular
- Joined
- Sep 19, 2013
- Messages
- 58
Hey guys,
After the ComboBox is updated I am still displaying their full name in a TextBox item to make sure they are doing the right thing. If their name don't appear in the TextBox, they have the opportunity to change the employee ID. This is where my problem starts, up to employee ID 47 (e.g. PFO-0047, where the "PFO-" value in the ComboBox is default) the implemented index/match function finding the correspondent name is working just fine, but as soon as the ID "PFO-0048" is picked or typed the corresponding name does not match. Infact whatever is picked in the ComboBox after 0047 ID the correspondent name becomes the very last name in the list every time. Always the very last name in the list. The list is a dynamic named range.
What you might also need to know if willing to save me from this misery is that the current list of employees have 2 different prefixes in their Employee ID, the last PFO number is 0050 then the list continues with IDs like PFF-0001 (different pay grade employees)
Please help if you can, many many thanks in advance...
I wonder if anyone can understand and also help me with the following. I use a userform to log user's (employees) start time by login with a 4 digit PIN into the application. If PIN don't match user will be prompted to try again or exit. This is to prevent employees from entering unwanted start times for others. The employees don't need to type or pick their names (to avoid long waitings) instead they will type a unique employee ID assigned upon hiring. I have a ComboBox with a RowSource attached to pick or type this employee ID.
After the ComboBox is updated I am still displaying their full name in a TextBox item to make sure they are doing the right thing. If their name don't appear in the TextBox, they have the opportunity to change the employee ID. This is where my problem starts, up to employee ID 47 (e.g. PFO-0047, where the "PFO-" value in the ComboBox is default) the implemented index/match function finding the correspondent name is working just fine, but as soon as the ID "PFO-0048" is picked or typed the corresponding name does not match. Infact whatever is picked in the ComboBox after 0047 ID the correspondent name becomes the very last name in the list every time. Always the very last name in the list. The list is a dynamic named range.
What you might also need to know if willing to save me from this misery is that the current list of employees have 2 different prefixes in their Employee ID, the last PFO number is 0050 then the list continues with IDs like PFF-0001 (different pay grade employees)
Please help if you can, many many thanks in advance...
Code:
Private Sub cb_Alk_Szam_AfterUpdate() 'cb_Alk_Szam is the ComboBox for employee ID picking
FullNam = WorksheetFunction.Index(Range("Alk_Nev"), WorksheetFunction.Match(cb_Alk_Szam, Range("Alk_Szam")), 0)
tb_FullName.Value = FullNam
tb_PIN.SetFocus
End Sub