Displaying a Summary of many fields (1 Viewer)

Evon

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2003
Messages
83
I have a situation where I use the output of a combobox in a query. When I run it everything is fine.

Now I want to make a summary of 9 of these text fields in the query. However, when I do this only the bound columns show up in the summary field. I can't get a summary of the second columns of the combo in the query.

I have been using the following successfully with regular text fields:

Summary: [Comodity] & "," & [Comodity1] & "," & [Comodity2] & "," & [Comodity3] & "," & [Comodity4] & "," & [Comodity5] & "," & [Comodity6] & "," & [Comodity7] & "," & [Comodity8] & "," & [Comodity9]
 
Last edited:

vbaInet

AWF VIP
Local time
Today, 22:08
Joined
Jan 22, 2010
Messages
26,374
I have a slight suspicion that your tables aren't properly normalised Evon.

With regards your problem, each column is a field so what you can do is combine the fields in the source query of your combo box.
 

Evon

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2003
Messages
83
I have a slight suspicion that your tables aren't properly normalised Evon.

With regards your problem, each column is a field so what you can do is combine the fields in the source query of your combo box.

Seems as if my thread has been hacked. I am seeing some java script type coding below it.

Anyway, back to the post. That is exactly what I did but because the fields are generated from a combo, I get a summary of the bound columns (column1 of each field).

I want to find a SQL expression that can reference the second column of the combo in query design view. It seems this is required when summarizing combo generated fields.

Understand. I am getting each field individually to output the data in column 2 when I run the query. However, when I try to summarize the fields in the manner I posted originally, and which you are suggesting, then I only get a summary of numbers and not the text that each field outputs when run individually.

I suspect PDreaddy might soon come up with the solution. However, thanks for trying to understand and hope you may be able to help.
 

vbaInet

AWF VIP
Local time
Today, 22:08
Joined
Jan 22, 2010
Messages
26,374
Are you sure PDreaddy isn't hacking it from Jamaica? ;)

Can you explain what you mean by "the fields are generated from a combo"? And is your combo box not bound to a table/query?
 

Evon

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2003
Messages
83
Some of the fields in the query are populated from comboboxes in the underlying tables. So when I run the queries these fields populate with the required data (column 2).

When I try to group those combo generated fields I get a summary of column 1's instead of the desired column 2's.
 

vbaInet

AWF VIP
Local time
Today, 22:08
Joined
Jan 22, 2010
Messages
26,374
It's still very unclear how it is "populated". Explain this process.

And what is the Row Source of the combo box?
 

Evon

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2003
Messages
83
It's still very unclear how it is "populated". Explain this process.

And what is the Row Source of the combo box?

Summary: [Comodity] & "," & [Comodity1] & "," & [Comodity2] & "," & [Comodity3] & "," & [Comodity4] & "," & [Comodity5] & "," & [Comodity6] & "," & [Comodity7] & "," & [Comodity8] & "," & [Comodity9]

All of the data in the above fields in a query are generated from comboboxes in the underlying table and form. When they are in separate columns in the query design view and I run the query, everything is fine.

I now want to send a summary of all those fields to one field in another form. Therefore, I did what you had suggested earlier by grouping them as an expression in one column of the query in the fashion shown in italics above. However when I run the query, I get a summary of the comboboxes' first columns (ID Numbers). I want to get a summary of the second comboboxes columns with the desired data.

Whew!
 

vbaInet

AWF VIP
Local time
Today, 22:08
Joined
Jan 22, 2010
Messages
26,374
Row Source is a property of the Combo Box. Look in the property sheet of the combo box and paste whatever is in there here. Summary: etc isn't a Row Source.

You've mentioned the words "generated" and "populated" already and I'm asking you how they are "generated/populated"? I need to see code or a procedure.

Failing that, upload a cut-down version of your db so I can see it for myself.
 

Evon

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2003
Messages
83
I feel you are complicating the problem.

All I am saying is: if you have these fields in a query, what expression would you use to group them all together in one column of the query design view.

The fields are enclosed in brackets [ ], and they are:

Summary: [Comodity] & "," & [Comodity1] & "," & [Comodity2] & "," & [Comodity3] & "," & [Comodity4] & "," & [Comodity5] & "," & [Comodity6] & "," & [Comodity7] & "," & [Comodity8] & "," & [Comodity9]

Each field is coded to include a comma in the output text field. However, bear in mind that each field got it's value from a combobox in the underlying table.

Summary is the name of the Expression in query design view.
 
Last edited:

Evon

Registered User.
Local time
Today, 22:08
Joined
Apr 1, 2003
Messages
83
When I run the expression (Summary) in the query, I get results and no error message. The only problem is I am getting the output from the wrong combobox column.
 

Users who are viewing this thread

Top Bottom