Disabling a control

  • Thread starter open a adobe file from a command button
  • Start date
O

open a adobe file from a command button

I have a text box named "vault_no" on a form. When the form opens if
"vault_no has data in it, I want a print button named "command43" to be
disabled. I used the following code and many variations but I could not get
it to work. Thanks for any help!!!

If Me!vault_No = IsNull() Then
Me!Command43.Enabled = True
Else
Me!Command43.Enabled = False
End If
 
J

Jeff Conrad

The correct syntax use of IsNull would be like so:

If IsNull(Me!vault_No) Then
Me!Command43.Enabled = True
Else
Me!Command43.Enabled = False
End If

However, you could simplify all of that code onto one line:

Me!Command43.Enabled = IsNull(Me.vault_No)

BTW, you may want to rename that command button to something
more useful. Perhaps cmdPrint or something. That would make
checking over your code easier in the future.

--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

in message:
 
O

open a adobe file from a command button

Jeff, thank you very much. That works just fine! Do you know of a good
reference book that I could buy to help me with Access/VBA/Macro's. I like
thinking of things to do but when I can't make them work....
 
Top