Disable subform from the main form

Ola

New member
Local time
Today, 16:33
Joined
Jul 8, 2005
Messages
3
Hi,
Am a new bee to Access programming. Am trying to disable the subform from the On_Current event of the main form. And later enable it with the onClick event on a button. But each time I open the form a keep getting the Error message "Application-defined or Object-defined error" .
Below is the code used to reference the subform

Forms![Delegate Details].frmSubCourseRegister.Enable = False
where Delegate Details is the main form and frmSubCourseRegister is the subform

NB:Am working with Access 2003

Tanx for your help
 
I don't think I've ever done this but you might try:

Forms![Delegate Details]!frmSubCourseRegister.Enabled = False

or

Forms![Delegate Details]!frmSubCourseRegister.form.Enabled = False
 
Hi, tanx for the response Ken.
I seem to get the error "Microsoft cannot find field frmSubCourseRegister" but frmSubCourseRegister is a form name. Any other suggestions

Cheers
 
Something to consider about subforms that may help here; When you place a subform object on another form, the subform object has it's own 'object' name which could be (and should be) completely different than the actual name of the form you are using as a subform. In this case you may be using the actual form name to reference the subform control name where you should be using the subform 'control' name...

Hope that makes sense.
 
Thanx Ken,
So how can i get the subforms control name and not the subforms actual name which am referencing
 
Just as you would any other object on a form, right click and select properties... :)
 

Users who are viewing this thread

Back
Top Bottom