Full Screen (subform)

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

Guest

I have a form with a subform. I would like to add a command button which
will give the user an option to expand the subform to "Full Screen". I tried
using the wizard (open form), but doesn't work. I also tried a macro, but
could not get that to work. It shows all the data not just for the data file
shown on the screen. Any suggestions? I am new to access...as you can tell.
 
Lori,

I's easy with some simple VBA code, to open the form and apply a filter
based on the current value of the control on the main form which is part
of the form-subform link. I can give you sample code, but it will be
much easier if you post back the names of:
the main form;
the subform;
the control on the main form that is part of the link;
the table field in the subform's recordsource, bound to which is the
control on the subform that is part of the link.

Nikos
 
Lori,

I understand both the table fields and the form controls share the same
name, FederalID? Assuming that this is indeed the case, then your code
behind the command button should be:

DoCmd.OpenForm "frmOfficers subform"
Forms![frmOfficers subform].Filter = "FederalID=" & Me.FederalID
Forms![frmOfficers subform].FilterOn = True
DoCmd.Maximize

where I have also assumed that FederalID is numeric; if it's text, then
the second line needs to be changed to:
Forms![frmOfficers subform].Filter = "FederalID='" & Me.FederalID & "'"

If you want, you can add this line of code:

DoCmd.Restore

to the On Close event of [frmOfficers subform], so the windows are set
back to normal (from maximized) when the subform is closed.

HTH,
Nikos
 
Back
Top