G
Guest
See below: not sure on the response where to tie the code to - tied to a
command button the the original form - on click event to
Docmd.openform........
not sure where the rest goes and how to capture the info from the form
soley for the purpose of filtering.
Thanks,
Barb
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
Barry Gilbert 5/8/2006 6:12 AM PST
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
command button the the original form - on click event to
Docmd.openform........
not sure where the rest goes and how to capture the info from the form
soley for the purpose of filtering.
Thanks,
Barb
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
Barry Gilbert 5/8/2006 6:12 AM PST
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