Form made for sole purpose of filtering another form

G

Guest

I would like to create a form to filter another form that would only include
four fields from the original form. The user doesn't know access at all and
would like to make it a user friendly as possilbe- therefore they wouldn't
now what to do with the filter by form- even if I gave them the button.

the field they want to filter by are clientid, material, and origin. would
like it to be able to handle and/or if possible??? Not sure how to start.
the client id field is a combo box - anyway to let them select from it for
the filter. After they input would like to have original form(filtered) show
up.

Any ideas,
thanks,
Barb
 
G

Guest

Babs,
How comfortable are you with VBA code? The way I would approach this is to
have the filter form open modally. The statement looks like this:

DoCmd.OpenForm "frmFilter", windowmode:=acDialog

In the close command button of the filter form, don't close the form, set it
to invisible:
Me.Visible=False

The next line in the main for grabs the values from the combobox/textboxes
of the filter form and builds a filter statement:

DoCmd.OpenForm "frmFilter", windowmode:=acDialog
Me.Filter = "ClientId = " & Forms!frmFilter!cboClientId & " and Material =
'" & Forms!frmFilter!txtMaterial & "' AND Origin = '" &
Forms!frmFilter!txtOrigin & "'"
Me.FilterOn = True
DoCmd.Close acForm, "frmFilter"

This sets the calling form's filter and closes the filter form. You will
probably have to mess with the syntax of the filter statement to get it to
work correctly. Also, you'll need to eliminate the built-in close button on
the filter form to force the use to use your command button.

HTH,
Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top