Reports - Difficuly in displaying data from fields and forms

R

Rob W

Greetings,

If i have a combo box on a form that runs a report, can i reference hidden
columns form it ( Im assuming as I only pass in the bound column, probably
not) ??
e.g.
=[Forms]![frmstudentletter]![cbostudentid]![Column](1)

Doesnt like the above ..

And how can I concatenate fields? It doesnt like

=[FirstName] & " " & [SurName]


Cheers
Rob
 
F

fredg

Greetings,

If i have a combo box on a form that runs a report, can i reference hidden
columns form it ( Im assuming as I only pass in the bound column, probably
not) ??
e.g.
=[Forms]![frmstudentletter]![cbostudentid]![Column](1)

Doesnt like the above ..

Statements like "it doesn't like" do not help us understand what your
problem is.
What happens?
Do you get an #Error or #Name error?
Do you get incorrect values?
No values?
Do you get prompted to enter a value?
What?

I'll take a guess....

=Forms!FormName!ComboName.Column(1)

Note: Combo boxes are zero based, so Column(1) is the 2nd column.
The Combo box's 2nd column on the one record displayed on the form
will be shown in the report, but the form MUST BE OPEN when the report
is run.
And how can I concatenate fields? It doesnt like

Once again, 'doesn't like' doesn't help!
=[FirstName] & " " & [SurName]

To concatenate fields, both fields must be included in the report's
record source and in the report.

=[FirstName] & " " & [SurName]

Make sure that the Name of this control is NOT the same as the name of
any field in it's control source expression.
 
J

John W. Vinson

Greetings,

If i have a combo box on a form that runs a report, can i reference hidden
columns form it ( Im assuming as I only pass in the bound column, probably
not) ??
e.g.
=[Forms]![frmstudentletter]![cbostudentid]![Column](1)

Doesnt like the above ..

You're aware that (1) refers to the *second* column, right? It's zero based.
Also, replace the final ! with a . and remove the brackets around Column; it's
the Column *property* of the combo that you want, and a period is the proper
delimiter for properties.
And how can I concatenate fields? It doesnt like

=[FirstName] & " " & [SurName]

"Doesn't like"?

Are FirstName and SurName fields which exist in the query, or in the table
upon which the query is based?
 
R

Rob W

Ive sorted out the combo box problem, thanks to BOTH replies.

Sorry for being so vague.

Im getting #ERROR message on report out.

The control source AND the name for the fields are the table fields
FirstName & Surname, the report is based on a query selecting table fields
FirstName & Surname.

Hope this is clear this time.
Apologies

Rob


John W. Vinson said:
Greetings,

If i have a combo box on a form that runs a report, can i reference hidden
columns form it ( Im assuming as I only pass in the bound column, probably
not) ??
e.g.
=[Forms]![frmstudentletter]![cbostudentid]![Column](1)

Doesnt like the above ..

You're aware that (1) refers to the *second* column, right? It's zero
based.
Also, replace the final ! with a . and remove the brackets around Column;
it's
the Column *property* of the combo that you want, and a period is the
proper
delimiter for properties.
And how can I concatenate fields? It doesnt like

=[FirstName] & " " & [SurName]

"Doesn't like"?

Are FirstName and SurName fields which exist in the query, or in the table
upon which the query is based?
 
J

John W. Vinson

Ive sorted out the combo box problem, thanks to BOTH replies.

Sorry for being so vague.

Im getting #ERROR message on report out.

The control source AND the name for the fields are the table fields
FirstName & Surname, the report is based on a query selecting table fields
FirstName & Surname.

Change the name of the control, I'd say! Access can get confused if there is a
field named SurName and also a control named SurName. Try naming the controls
txtSurName say, and use the fieldnames in the controlsource.

You may also want to consider using a calculated field in the report's
Recordsource query by typing

FullName: [FirstName] & " " & [SurName]

in a vacant field cell, and using FullName as the control source of a textbox.
 
F

fredg

Ive sorted out the combo box problem, thanks to BOTH replies.

Sorry for being so vague.

Im getting #ERROR message on report out.

The control source AND the name for the fields are the table fields
FirstName & Surname, the report is based on a query selecting table fields
FirstName & Surname.

Hope this is clear this time.
Apologies

Rob
*** snipped ***

Clear as mud to me.
What is the actual name of this CONTROL?
It must not be "FirstName" nor "SurName".

If an Access control has the same name as the name of a field used in
it's control source expression, Access get's confused.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

retrive record from combo box 1
Combo Box Query 10
Display Report Total in Form 1
Combo Box help please 4
Forms as reports 0
Form Fields - Stacking vs Tabular 4
OpenForm trouble 2
Displaying the RecordCount 3

Top