Test Statement (1 Viewer)

twosides

Registered User.
Local time
Today, 10:23
Joined
Jul 19, 2005
Messages
38
Hi Folks,
I would like to know if there is a way of testing for values using an IF statment.
I know there is but my knowledge of IF statments does not extend to this senario.
So what I want to do is basically test for the following:

OrderPlaced = -1 AND
FromStock = 0 AND
Arrived = -1 AND
InTable = 0

These are all fields in the "Car" table.

I want to use the condition to enable a button on a from if the above is true, but to hide it if not, this part I can do but only for a single criteria at the moment.

Any help at all will be most useful, as usual,
Cheers
 

spasticus

Registered User.
Local time
Today, 18:23
Joined
Apr 17, 2007
Messages
61
if those 4 are fields in the table or query your form is based on the it should work if you just put what you've written into an if; as long as you put the name of each field in square brackets []. so...

if [OrderPlaced] = -1 and ... then
 

WayneRyan

AWF VIP
Local time
Today, 18:23
Joined
Nov 19, 2002
Messages
7,122
twosides,

Use your form's OnCurrent Event:

Code:
If Me.OrderPlaced AND Not FromStock AND Arrived AND Not InTable Then
   Me.YourCommandButton.Enabled = True
Else
   Me.YourCommandButton.Enabled = False
End If

hth,
Wayne
 

Users who are viewing this thread

Top Bottom