Enable button based on two values

janith

CPA
Local time
Today, 22:28
Joined
Apr 11, 2012
Messages
65
Hi,

I want to enable a button on the form based on either 2 values

If txname.value = " vb- 99453037" or "43331954" then
Button. Enabled = true
Else
Button. Enabled = false

It only works for first value (vb-99453037)and not for both any suggestions??
 
You have to repeat the field:

If txname.value = " vb- 99453037" or txname.value = "43331954" then
 
So by doing so can I also include a third value?
 
Sure. If it's something that will change over time, it might make more sense to have a field in a table whose value will determine this. You don't want to have to change the VBA code every time they add a code or whatever.
 
True that make sense.. Probably will try a combo box to achieve the same result.. Thanks
 

Users who are viewing this thread

Back
Top Bottom