Dlookup not bringing back right record

BWAT

Registered User.
Local time
Today, 18:37
Joined
Jan 18, 2008
Messages
11
Hello, I am sorry..this may be long and confusing. Ill do my best.

I have an issue concerning a text box with a Dlookup value. It is on a continuous form which uses a parameter query as its record source. The parameter is date. So I would open the form, select a date, and the form only shows data associated with that date.

Say tableX is a list of accounts with different dates and amounts

On each line of data on the form (which would be account, date, amount, etc), I would like to bring back the max date and amount associated with that account from tableX, into a text box. I've created 2 queries that pull the data like I want, but the Dlookup doesnt seem to be working correctly. The Dlookup appears to be filtering by the date used in the parameter query behind the form, instead of what the query I made is pulling.

When I actually open the query, the data is what I need.

Am I doing something wrong, or is this because the form is filtering by date?
 
My suggestion is to have the text box that you select the date in be non-bound. Then the forms underlying query uses it as a parameter.
 
to be more clear, I actually have it so that you select a date from a combo box on a separate form, then click a button to open the new form. The query behind the new form looks at that combo box for its parameter. But it seems like the textbox I am using the Dlookup in, is only considering fields that the form is filtered by...even though it is an unbound textbox. And the query it looks at works fine when I run it.
 
I would try loosing all the filter stuff and simply use the combo as a param.
 

Users who are viewing this thread

Back
Top Bottom