what is wrong with the code / which event to use

B

balu

i have an command button over an openup form to open an another form,
i want the form to enable and disable under conditions
(1) whenver specified textboxes not filled /wrong data used
(2) whenever typed data deleted
how to get through this please
i used, event form current()
if isnull(text1) then msgbox("fg")
command1.enable=false
elseif isnull(condition2) theb msgbox("gh")
command1.enable=false
else command1.enable=true
but the command1 is getting disabled but not getting enabled again?
 
S

Steve Schapel

Balu,

Try like this...

If IsNull(Me.text1) Then
MsgBox "fg"
Me.Command1.Enabled = False
ElseIf IsNull(condition2) Then
MsgBox "gh"
Me.Command1.Enabled = False
Else
Me.Command1.Enabled = True
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top