Ms Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

what code is need to have a text box properties enbled = no when another text
box receive an entery?
 
In the after update of the text box that recieves the entry

If isnull(Me!textbox1) then
Me!textbox2.enabled = true
else
Me!textbox2.enabled = false
end if

I assumed that if somebody comes back and deletes the data in textbox1 you
would then want the other enabled again
 
"Access General Questions" <Access General
(e-mail address removed)> wrote in message
what code is need to have a text box properties enbled = no when
another text box receive an entery?

By "receive and entery", do you mean that when ever this other text box
has any value in it, the first text box should be disabled? For that
you'd need code in two places: in the form's Current event (to set the
initial enabled status and make it right for existing records), and in
the AfterUpdate event of the other combo box. Example code might look
like this:

'----- start of example code -----
Private Sub Form_Current()

Me.Textbox1.Enabled = Not IsNull(Me.Textbox2)

End Sub

Private Sub Textbox2_AfterUpdate()

Me.Textbox1.Enabled = Not IsNull(Me.Textbox2)

End Sub
'----- end of example code -----
 

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

Back
Top