Validating a textbox in a form based on the content of another combo box (1 Viewer)

Graham63

Registered User.
Local time
Today, 18:42
Joined
Mar 22, 2012
Messages
20
Hi,

Newbie working my way through several needs on a form called Device Input Form created to fill out a table called Devices.
On the form I have a combo box called Device_Type. I also have a text field called Sticker_Barcode which will be manually filled by a barcode scanner. The barcode's 2 leading characters of 8 define the device type and vice versa. To avoid anyone scanning the incorrect Device type barcode ref into the record I want to validate the 1st two characters before update depending on the Device type selected and ensure 8 characters only by rule are used. All information updates to the same table and numbers and text are used.

ie
if Device_Type = "Some Device Type" then
Sticker_Barcode is null or like "A1??????"
else msgBox "Type error!" vbcancel.

What code can I use to do this? Thanks for any assistance
 

Users who are viewing this thread

Top Bottom