Good Morning,
I would like to validate a value entered in a textbox to make sure it matches one of the values in a table. The approach I took is a dlookup, but I can only get it to work for one of the values (the first one)
Here is my code
I am guessing my criteria is bad or the table design is bad. My table is below. I would like to make sure the value in the textbox AFOs matches one of the values in the AFO column when I submit my form.
Office AFO
NASHVILLE 101
NASHVILLE 101, 259
NASHVILLE 101,259
NASHVILLE 101259
NASHVILLE 259
NASHVILLE 259101
I would greatly appreciate any help! Thank you!
I would like to validate a value entered in a textbox to make sure it matches one of the values in a table. The approach I took is a dlookup, but I can only get it to work for one of the values (the first one)
Here is my code
Code:
If Me.AFOs.Value <> DLookup("AFO", "AFO_LOOKUP", "Office = '" & Me.Approver_Office.Value & "'") Then Me.AFOs.enabled = True And MsgBox("AFO(s)Invalid. Please enter valid AFO and format AFO,AFO for single Service Center and format with a space between AFOs for multiple Service Centers (AFO, AFO)")
Office AFO
NASHVILLE 101
NASHVILLE 101, 259
NASHVILLE 101,259
NASHVILLE 101259
NASHVILLE 259
NASHVILLE 259101
I would greatly appreciate any help! Thank you!
Comment