If macros. if this = and that = then

shutzy

Registered User.
Local time
Today, 22:57
Joined
Sep 14, 2011
Messages
775
how do i do this. i need to enter this on a payment scrren for vouchers. i have a box for how much is being paid by voucher (Voucher), a box for voucher No.(VoucherNumber), a box for voucher amount(VoucherAmount) and last of all a box for remaining voucher amount(txtVoucherRemaining)

i tried this

If [Voucher]>0 And [VoucherNumber]=0 Then (the =0 is because the default is zero, so if they have not changed it, it will still be zero)

MessageBox
bla bla

StopAllMacros

it dosnt seem to like it. its a bit likt i could do with an And rather than 'Then'.

has anyone got any ideas for this.

thanks
 
Howzit

Try

Code:
if me.voucher >0 AND  me.vouchernumber = 0 then
  msgbox "yourmessage",vbokonly,"Yourtitle"
  'your rest of code
else
    ' your oither code \ action
end if
 
not trying to be ungreatful but will this work in a macro?
 
Howzit

No. I would test the content of the vouchernumber and voucher field before setting off the macro(s). Only when the 2 fields meet your criteria would the macro be set off.
 
sorry for jumping the gun there. yes it does workmiss the me. out and replace it for [....]. it seems the only thing i was missing was AND rather than And.

thanks
 

Users who are viewing this thread

Back
Top Bottom