473,388 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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:

Startdate
Enddate

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!

//Daniel
Nov 8 '06 #1
1 2570
NeoPa
32,556 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

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

Similar topics

6
by: cyoung311 | last post by:
I'm trying to do an automatic update of one table from another through a form. Basically, when a selection is made for an item, in this case a particular workshop, I want to get the associated...
4
by: Laura | last post by:
Here's the situation: I'm trying to use an update query to copy data from one row to another. Here is the situation: I have 5 companies that are linked to each other. I need to show all 5...
5
by: Richard Stanton | last post by:
Hello all My database has a main form linked to table1. It has several subforms on the main form, all linked to table2. Table1 and Table2 are linked by primary/foreign key, no duplicates...
1
by: abefuzzleduser2 | last post by:
we use Access 2000 with linked tables in SQL Server 2000. I have a form and a datasheet subform based on a table. This was not related to the parent table before and I was changing nvarchars to...
3
by: stuart.medlin | last post by:
I have an Access 97 application that has a basic form (Transcript) and subform. The subform has a query as a recordsource that returns records from a table: SELECT DISTINCTROW Transcript.NCID,...
3
by: RookieDan | last post by:
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. ...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
0
by: emalcolm_FLA | last post by:
Hello and TIA for any help with this non profit Christmas assistance project. I have an applicant (app history) and child (child history) tables (4 total). I need to grab the next available (in...
2
by: adigga1 | last post by:
Good Day Experts, I have an issue dealing with a subform operation whereby, each time I select the value field of the subform, that same value is then placed into the source table as a new...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.