By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Query in Subform to be updated with DateFields in Mainform

P: 8
MS ACC 2003, WS.

In the subform i have query showing the results according to this SQL. It shows (grouped) number of customer data belonging to a specific dealer/vendor has in a related table.

Used tables:
Dealer/Vendor table is called SE_DealerList
Customer table is called CustomerData

This SQL shows the result, between 2 dates (DateField0 and DateField2):

SELECT [SE_Dealer List].retailerNumber, [SE_Dealer List].retailerName, [SE_Dealer List].VisitingCity, Count(*) AS Expression1

FROM [SE_Dealer List] INNER JOIN CustomerData ON [SE_Dealer List].retailerNumber=CustomerData.DealerID

WHERE ((CustomerData.[Invoicing Date]>=Forms!MainForm!DateField0 And CustomerData.[Invoicing Date]<=Forms!MainForm!DateField2))

GROUP BY (...)

Now: The query result is shown as a table in subform, where the DateField0 and DateField2 in the MAINform should automatically update the data shown in the subform.

How should i do it? I have tried update macros but i cannot find the right method...?

Please help!

Nov 9 '06 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 31,299
I can't help much with the subform linking stuff I'm afraid, but you may want to use an easier form of WHERE clause as follows :
Expand|Select|Wrap|Line Numbers
  1. WHERE (CustomerData.[Invoicing Date] Between Forms!MainForm!DateField0 And Forms!MainForm!DateField2)
Nov 9 '06 #2

P: 8
Thanks NeoPa, you helped me out with some new ideas on the last tip (I couldnt find it again so I wrote a new question?!)

Ill try some wild stuff tonight... !
Nov 9 '06 #3

Expert Mod 15k+
P: 31,299
That's cool Rookie.
BTW - the other thread is here ( )
To find any of your created threads, just click on your name to be taken to your profile.
In the profile are options to see all posts by the selected member as well as to see all threads started by that member.
Nov 9 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.