Currency and If Statement

  • Thread starter Thread starter Bob Quintal
  • Start date Start date
B

Bob Quintal

(e-mail address removed) wrote in
Hi. I'm trying to write simple code on a subforms On Current
event to disable/enable a command button based on the value of a
text box. The textbox is formatted to currency. Here's a sample
of what I need but it's not working (I think because of the
currency).

if me.totalpurchase > 250 then
cmd.PrintGC.enabled = true
else
cmd.PrintGC.enabled = false
end if

Hope someone can help.
cmd.PrintGC isn't a valid Controlname, it cannot have a period. If
you are trying to reference PrintGC on form cmd

Forms!cmd!PrintGC.enabled = true
Since you are in the code module for the form, Forms!cmd! should be
replaced with Me!PrintGC.enabled = true
 
Hi. I'm trying to write simple code on a subforms On Current event to
disable/enable a command button based on the value of a text box. The
textbox is formatted to currency. Here's a sample of what I need but
it's not working (I think because of the currency).

if me.totalpurchase > 250 then
cmd.PrintGC.enabled = true
else
cmd.PrintGC.enabled = false
end if

Hope someone can help.
 
Back
Top