Enabling function dont work

kabir_hussein

Registered User.
Local time
Today, 09:24
Joined
Oct 17, 2003
Messages
191
Hi i am doing a form which also contains a sumform. I dont want users to go striaght to the sub-form and then click on the main form as this causes problem.

What i am trying to do is a enabling function where once the user selects the textbox on the main form the sub-form will be enabled. However for some reason it does not work i think it may have something to do with typing the textbox of the sumform different to what i have done.

here is the code i am using

Private Sub BuyersName_Change()
If BuyersName <> True Then
PartID.Enabled = True
PartID.SetFocus
End If
End Sub

the buyersName is on main form and PartId on subform

any ideas, thank you
 
Put the code in the subform and reference the Main form to check the condition
 
Hi rich thanks for the advice but im a bit confused.

I have put the code on the subform, however the subform i am intending to have most of the text boxes init are disabled. they only become enabled once the buyername (textbox) is changed. this is on the main form

if i put the code on the subform i.e. before update. what code do i use to reference the main form back to the code

thanks once again

kabir
 
Your code belongs in the subform Form_Current event not the before update

If Forms!MainFormName!MyControl = Something Then
DoWhatever
 

Users who are viewing this thread

Back
Top Bottom