By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,762 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,762 IT Pros & Developers. It's quick & easy.

enable a textfield based on the value in a combo box.

P: n/a
Rex
I have a main form and a subform. The main form has a combo box
control and the subform has a textfield.

What I want to do is when the main form loads it should check the
value of the combo box and if it, lets say "MZ" then the textfield in
the subform must be enabled otherwise it should be remain disabled.
This should be done without setting any explicit focus.

Any help would be greatly appreciated.
Jan 8 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rex wrote:
I have a main form and a subform. The main form has a combo box
control and the subform has a textfield.

What I want to do is when the main form loads it should check the
value of the combo box and if it, lets say "MZ" then the textfield in
the subform must be enabled otherwise it should be remain disabled.
This should be done without setting any explicit focus.

Any help would be greatly appreciated.
In the MainForm's OnCurrent event you could enter something similar to
Me!SubFormName!Textbox.Enabled = (Me.ComboboxName = "MZ")

Free
http://www.youtube.com/watch?v=nblsi4Ke_qA
Jan 8 '08 #2

P: n/a
Here is one thing you could try:

Private Sub Combo10_AfterUpdate()
If Combo10 = "whatever" Then
Me.frmSubForm.Controls("Text0").Enabled = True
'--or
'Me.frmSubForm.!Text0.Enabled = True
End If
End Sub

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jan 9 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.