Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Buttons enabled false thing Help!

Status
Not open for further replies.

Jar80

Technical User
Jun 13, 2004
69
FI
What is the code that make this work!
I have form that contains field 1 (combo box) and there are one button named button 1, now how i gonna get this button value (enabled=false) if field 1 dosen´t contains any characters so it´s null or empty.
 
Hi

If Len(Trim(Nz(MyCombo,"")&"")) = 0 Then
cmdMyButton.enabled = False
Else
cmdMyButtom.Enabled = True
End If

you need code like this in the on open event of the form, and in the after update event of the combo box

you need to use your own control names of course in place of the "my" names I have used

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Dosen´t work.
I think that code works because it dosen´t throw any error, but button value isn´t enabled=false in conditions.
 
Hi

Post your code, and tell me what happens when you step through the code using the debugger, ie which of the two options (true or false) are executed

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Button is allways enabled=true.
 
Hi

Yes, so do you want me to be a mind reader, please post your code (including the event header) and answer the question ref stepping through the code using the debugger

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
No it´s work, thanks.
Btw that combo box event must be on current.
 
Now it´s work, thanks.
Btw that combo box event must be on current.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top