469,579 Members | 1,830 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Updating a query result (table) in a subform

Greetings fellow Accessers!

Im new but in Access, but I have some background in different coding.

I have a programme loading customer data into Access belonging to BMW dealers in Europe.

Every dealer reports several customers and I have today a query that sorts out how many customer data each BMW dealer sends in to us. The query is also referring to a startdate and enddate (to be filled in in a messagebox) so that i can choose time period for lets say October, and then look at the deliveries only for october.

I want to make this dynamic with text boxes as entry fields in a form, and the result table in a subform.

This one will be easy for ya!

In a form I have:


Subform Listing:
(Dealer X, No. entries of customer data)
(Dealer Y, No. entries of customer data)
(Dealer Z, No. entries of customer data)

How can i set values in the Startdate & Enddate and then Update the Subform Result? The query is already linked to the boxes - so thats not the problem!

How can I make it dynamic so that lets say a CommandButton can update the Query Result in the Subform?

Thanks for helping out!

Nov 8 '06 #1
1 2355
32,198 Expert Mod 16PB
You will have to change the field names to your own, as I don't know what yours are.
Try setting the 'RecordSource' property of the subform to something like :-
Expand|Select|Wrap|Line Numbers
  1. {Specify subform here}.RecordSource = _
  2.     "SELECT [DealerID], Count([DealerID]) AS NoCusts " & _
  3.     "FROM [tblDealer]"
  4.     "WHERE ([EntryDate] Between #" & Format(Startdate, "M/D/YYYY") & _
  5.             "# And #" & Format(Enddate, "M/D/YYYY") & "#) " & _
  6.     "GROUP BY [DealerID]"
This code should be executed as part of the CommandButton OnClick event procedure.
Nov 8 '06 #2

Post your reply

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

Similar topics

5 posts views Thread by Richard Stanton | last post: by
1 post views Thread by abefuzzleduser2 | last post: by
reply views Thread by emalcolm_FLA | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.