Buttons in subforms

  • Thread starter Thread starter 111
  • Start date Start date
1

111

I have a form with two subforms in it. one of the subforms has a button that is
supposed to open a record and display it in another form. the problem is the
button works fine when i use it on the form directly. as soon as i put that
form into another form (and turn it into a subform ) the button won't work
anylonger.

can anyone suggest a way around this?
tks
Steve
 
Steve,

Chances are the problem lies in the references to the form's controls in the
VB code. To give you an example:
While it is a self-contained form, a control on it would be referenced as:
Me.ControlName (in the form code module)
or
Forms!FormName.ControlName (in another code module)
or
Forms("FormName").Controls("ControlName") (in another code module)

When it becomes a subfornm in a main form, the reference needs to be changed
to:
Me.SubformName.ControlName (in the main form code module)
or
Forms!MainFormName.SubFormName.ControlName (in another code module)
etc.

Check your code for this kind of refrence problem. It will be easy to spot
the wrong references when you try to run the code, as the debugger will take
you to the first problem encountered each time.

HTH,
Nikos
 
Hi Steve,

How is the issue going on your side? Does Nikos' suggestions address your
problem? Let us know if you need further assistance on this issue.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top