Can someone help? please (1 Viewer)

p4man

New member
Local time
Today, 09:52
Joined
Nov 10, 2018
Messages
10
Can someone help me with VBA code for the following
I have a table with people’s names and what keys that they can have called (tblEmployee)
Name John
Key1 30
Key2 22
Key3 15
In a form (frmKeycollector)their name is entered, (first field) lookup from above table
Next field is Key number that is taken key can be entered
That is working fine
What I need is after the key number is put into the key field on the form I want the code to look at the tblEmployee name and see if that key number is in Key1 or Key2 or Key3 if so continues, if not display an msg box then go back to start.
Hope someone can help
 

Gasman

Enthusiastic Amateur
Local time
Today, 17:52
Joined
Sep 21, 2011
Messages
14,263
Wrong approach I would say.
Have a table tblKeys, linked to tblEmployee

Then look up tblKeys for EmployeeID and key value.

tblKeys would look like
KeyID
KeySequence
KeyValue

HTH
 

Users who are viewing this thread

Top Bottom