How to crea a DropDownBox that will return monthly revenues, by selecting a client?

Goat.Cheese

Registered User.
Local time
Today, 14:49
Joined
Jul 10, 2012
Messages
20
What i have is a table with client names, purchase dates and their value.
I also possess a query which shows the monthly sum total of said clients' purchases for the last year.

What I need to do is create a drop down menu, in which, when a client name is selected, I could see his "monthly shopping total" history
 
So I believe the Monthly shopping total is the query. So on the design of the Query change the criteria as
Code:
Like Forms!frm_Name.cmbo_BoxName & "*"
Then in the ComboBox Afterupdate event, just open the Query using..
Code:
DoCmd.OpenQuery qry_Name
 
Uhm...That stumped me. Change the criteria of what in the query design?
All I use in the query is "client name", the sum of "sales total" and
"Expr1: DatePart("yyyy";[Datefield]) & "/" & Format(DatePart("m";[DateField]);"00")"

Still a layman at this.
 
The criteria of the under Client name.. the where part will have a particular name right, instead of giving a name, you are using the result from the ComboBox.
BTW.
DatePart function and Format involves , not a ;
 
I would change "Expr1" to something that makes sense.

Just my 2 cents
 
Just change the title to something more obvious, so in the future when you come back you have some clue as to what Expr1 is.

At least thats what I would do!
 
So is it working now? I do not understand this..

You replied to the wrong fella :D.

I'll be able to try what you suggested tommorow, sorry for the late reply.
One question:

(Like Forms!frm_Name.cmbo_BoxName & "*" )

Should i copy it exactly like that or do i change BoxName with the name of one of my fields?

Anyway, thanks.
 
Ya, change "cmbo_Boxname" to the name of your combo box, which should be something like cboXXXXXX. also change "frm_name" to whatever your forms name is.
 
Lol.. How embarrassing.. anyway.. Yes, you should rename frm_Name to your form name and the combo_BoxName to the one you have in your form.
 
But, i dont have a form. What i have is a table with client names, purchase dates and their value. And the clients'monthly purchase totals.

So i need to create a form then? I tried creating the drop down menu by going into form design view, deleting the client names box and replacing it with a combo box. But then what follows is a bunch of menus that I cant figure out how to work with.

Again, what I need to do is create a drop down menu, in which, when a client name is selected, I could see his "monthly shopping total" history
 
Last edited:
in your combo's properties use a distinct select query (src should be Client name column from your client table)

If you dont use distinct you'll get repeating values
 
Also,
BTW.
DatePart function and Format involves , not a ;

When i replace the ; with , in DatePart("yyyy";[Дата]) & "/" & Format(DatePart("m";[Дата]);"00")

I get a syntaxis error.
 

Users who are viewing this thread

Back
Top Bottom