How to run this query?

Chipcom

Registered User.
Local time
Today, 05:46
Joined
Apr 13, 2006
Messages
63

Hi

I need to define this query:

I have 2 unbounded fields : ShowMonth and ShowYear (Each field represent the month and the year of Date field)
And UserName field

I need to define query that shows the dates and the UserName accordding to ShowMonth,ShowYear and UserName field (Without SQL).


The query works when I run the query alone (When the Form is already open).
But when I open the forum (That contain the query in the subform) I get the popup fields that related to the query and I always need to fill it again and again.

What I need to do to overcome this problem?

When the form opens the subform query was loaded first and then the popup query fields shows.

I think that if I could disable the query first and after that the to enable the query the problem will be solved - But How?
 
Just to help you out - you may want to place a small example of the DB on the site so we can see what your are working with? Just a few records are all that is needed (Dummy Data)
 
You're talking about dynamic SQL here and you aren't getting around it without parameters (which you're having to re-enter each time -- bad), or binding your controls and executing some simple SQL in code (or as a query by changing a QueryDef's SQL in code). One final way is to change the record source of the query on the fly using field names, which is limiting.

I can show you how to do these things (as can some others here), but a search for Dynamic SQL in here may prove helpful.
 

Users who are viewing this thread

Back
Top Bottom