View Full Version : Hi!... Can you alter query criteria through code?


paulmcdonnell
10-15-2001, 07:46 AM
Hi guys,

I have a query which i want to change the criteria of, depending on the control that was clicked from a form.

This means that a form uses a query as its recordsource. Some controls on the form choose different queries for the form recordsource.

I want one of the controls to use the same query but alter the query critera, so that i don't have six or seven separate queries but have one where the criteria can change slightly on the click of a command button..

is this possible

Hope you guys can help

Cheers
paul

Chris RR
10-15-2001, 09:10 AM
If you are using Access tables, you can simply set up a parameter query to do this.

For linked tables, you'll need to actually modify the query itself in code. Look up the Microsoft Knowledge Base article Q131534.