Filter a popup form

  • Thread starter gsnidow via AccessMonster.com
  • Start date
G

gsnidow via AccessMonster.com

Greetings all. I am trying to filter a popup form based on a datasheet field.
When I double click on the field 'EWO' on the datasheet I am trying to open a
popup, whose record source is a view having EWO as a field, and filter it to
the record clicked on the datasheet. To open the form I have the following
in the double click event of the EWO field on datasheet, 'frmMain':


Private Sub EWO_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmPopup"

End Sub

I can not seem to get the syntax of the filter on frmPopup though. This is
what I trying.

Private Sub Form_Open(Cancel As Integer)

Me.Filter = "txtEWO =" & Forms!frmMain.EWO

End Sub

txtEWO is the field on the popup I want to filter. I am not sure what I need
to do. Any help would be greatly appreciated.
 
O

OldPro

Greetings all. I am trying to filter a popup form based on a datasheet field.
When I double click on the field 'EWO' on the datasheet I am trying to open a
popup, whose record source is a view having EWO as a field, and filter it to
the record clicked on the datasheet. To open the form I have the following
in the double click event of the EWO field on datasheet, 'frmMain':

Private Sub EWO_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmPopup"

End Sub

I can not seem to get the syntax of the filter on frmPopup though. This is
what I trying.

Private Sub Form_Open(Cancel As Integer)

Me.Filter = "txtEWO =" & Forms!frmMain.EWO

End Sub

txtEWO is the field on the popup I want to filter. I am not sure what I need
to do. Any help would be greatly appreciated.

If the popup is using this table as a recordsource, then you have to
filter the underlying data, not the textbox. The popup form should
have a .filter property and a .filteron property. Take a look at the
help files to find out how to use them.
 
G

gsnidow via AccessMonster.com

Thanks OldPro. I thought it might be easier than that. I made it work by
changing the view to a parameterized stored procedure, then setting the input
parameters of the popup to @ewo = forms!frmMain!ewo. Thanks for the turn in
the right direction, it now works like a charm
Greetings all. I am trying to filter a popup form based on a datasheet field.
When I double click on the field 'EWO' on the datasheet I am trying to open a
[quoted text clipped - 22 lines]
If the popup is using this table as a recordsource, then you have to
filter the underlying data, not the textbox. The popup form should
have a .filter property and a .filteron property. Take a look at the
help files to find out how to use them.
 

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