UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Enabling and Disabling a text box    
 
   
op66fantasie
post Nov 23 2010, 09:22 AM
Post #1

UtterAccess Member
Posts: 31



Hi,

I'm a newbie with vba and i'm tyring to accomplish something i believe should be very easy, but for some reason is not working.... I have a form with one combo box 'A' and one text box 'B'. In the 'On Current' event of the form, I'm trying to say that whenever a value is selected in A then text box B gets disabled, whenever A is blank, or Null, then B gets enabled. Heres my code:

----------------------------------------------
Private Sub Form_Current()

If Me.A = Null Then
B.Enabled = True
Else
B.Enabled = False
End If

End Sub
----------------------------------------------

What ends up happening is B stays disabled no matter what change is made. Is it something with the code or the event? Thx.
Go to the top of the page
 
+
rbianco
post Nov 23 2010, 09:24 AM
Post #2

UtterAccess VIP
Posts: 1,730
From: Carrollton, TX



CODE
If IsNull(Me.A) Then


Go to the top of the page
 
+
op66fantasie
post Nov 23 2010, 09:35 AM
Post #3

UtterAccess Member
Posts: 31



Thx!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 10:29 PM