Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querry based on a filter

Status
Not open for further replies.

BSC5905

Technical User
Apr 30, 2004
20
0
0
US
Is there away to create a form based on a query. Then add a combo box to filter the the query and then print the results of the filterd data? In other words in the criteria section of the Query design view window, can I create a combo box to use a a filter. Then create a form of the query and use combo box to filter the data and then print a report.
 
on the reports OnOpen event you could enter:
Me.RecordSource="Select * From YrTabel Where YrID=" & Forms!YrForm!YrCombo
or
Me.RecordSource="Select * From YrTabel Where YrID='" & Forms!YrForm!YrCombo &"'"

You can use the same tecnique on your combo:
On the AfterUpdate event on some field or combo insert something like this:

Me!YrCombo.RowSource="Select YrId, YrText From YrTbl Where YrType=" & me!Yrfield

Herman
Say no to macros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top