filtering a form based on a filter on an open form

D

DawnTreader

Hello all

access 2007.

i have 2 forms one called Issues the other HQ tracker. the first shows a list of all the issues. the second all the follow up actions taken on certainissues. when a user right clicks on cells and filters the issue list and then clicks a button i need the HQ tracker list to filter to the issues thatare showing in the issue form. i thought that i could use the forms filterproperty but the fields are not the same on both forms, only the issue ID is the same.

i have thought i could use the recordsetclone to copy into a temporary issueID table that i can then filter on the HQ tracker form, but i have no ideahow to cause the data to populate the table. i was trying this:

Set rsinsertIssues = Me.Form.sfrmissuetracker.Form.RecordsetClone

With rsinsertIssues
rsinsertIssues.MoveFirst
Do
CurrentDb.Execute "INSERT INTO utblHQTrackerFilter ( IssueID ) VALUE (" & rsinsertIssues("IssueID") & ");"
rsinsertIssues.MoveNext
Loop While Not rsinsertIssues.EOF
End With

i also thought that i could try to do this:

CurrentDb.Execute "DELETE * FROM utblHQTrackerFilter"
If Me.Form.sfrmqryIssueTracker.Form.Filter <> "" Then
MsgBox Me.Form.sfrmqryIssueTracker.Form.Filter
CurrentDb.Execute "INSERT INTO utblHQTrackerFilter ( IssueID ) SELECT qryIssueTracker.IssueID FROM qryIssueTracker WHERE '" & Me.Form.sfrmqryIssueTracker.Form.Filter & "';"
End If

DoCmd.OpenForm stDocName

basically use the filter to manage a insert by code.

niether of these approaches are working. the last one gives me the error 3061 too few parameters. expected 1. my query is using one parameter that comes from a form. that textbox can be a number or a "*" wildcard. the parameter looks like this: Like [Forms]![frmMainMenu]![txtServiceRepID]

should that not work in the code?

i am greatful for any help any one can give.

Thanks
 
M

Mike Painter

Hello all

access 2007.

i have 2 forms one called Issues the other HQ tracker. the first shows a list of all the issues. the second all the follow up actions taken on certain issues.

If you use an "HQ Tracker" subform on Issues then it is a trivial
problem to do what you want.
The Northwind database, is one place where you can find example.

Placing both on a third form would allow even more control.
EG Show me all information about Issue X between this date and that date.
 

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