Text Box Value

S

Srowe

I have a combobox on a form that allows the user to pick a name from a list.
What I am trying to do is have a corresponding textbox field on a report
display the value that the user picked.

What is being displayed in the textbox is the comboboxes first column, the
autonumber or column(0). when I changed the conttrol source of the text box
to display column(1) I get "#Name?" in place where the name should be
displayed on the report. Wondering what I am doing wrong.

Scott
 
D

Douglas J. Steele

I just tried it, and it worked fine for me.

Exactly what did you put as the ControlSource for your text box? I used
=Combo0.Column(1) (although Access changed that to =[Combo0].[Column](1))

I did get #Name when I mistyped the name of the combo...
 
S

Scott

Her is the code attached to the field on my report:

=[OccDescription].[Column](1). When I preview the report all I get for a
value in that field is "Name?"

My combo Box name is OccDescription and it contains two values , the
autonumber assigned to each Occurence and the description of that occurence.
I have no issues with the form just with the report.

When I leave the control source at just OccDescription The value that comes
up on the report is the assigned number.

Am I doing something wrong.

Scott


Douglas J. Steele said:
I just tried it, and it worked fine for me.

Exactly what did you put as the ControlSource for your text box? I used
=Combo0.Column(1) (although Access changed that to =[Combo0].[Column](1))

I did get #Name when I mistyped the name of the combo...

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Srowe said:
I have a combobox on a form that allows the user to pick a name from a
list.
What I am trying to do is have a corresponding textbox field on a report
display the value that the user picked.

What is being displayed in the textbox is the comboboxes first column, the
autonumber or column(0). when I changed the conttrol source of the text
box
to display column(1) I get "#Name?" in place where the name should be
displayed on the report. Wondering what I am doing wrong.

Scott
 
S

Scott

Her is the code attached to the field on my report:

=[OccDescription].[Column](1). When I preview the report all I get for a
value in that field is "Name?"

My combo Box name is OccDescription and it contains two values , the
autonumber assigned to each Occurence and the description of that occurence.
I have no issues with the form just with the report.

When I leave the control source at just OccDescription The value that comes
up on the report is the assigned number.

Am I doing something wrong.

Scott


Douglas J. Steele said:
I just tried it, and it worked fine for me.

Exactly what did you put as the ControlSource for your text box? I used
=Combo0.Column(1) (although Access changed that to =[Combo0].[Column](1))

I did get #Name when I mistyped the name of the combo...

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Srowe said:
I have a combobox on a form that allows the user to pick a name from a
list.
What I am trying to do is have a corresponding textbox field on a report
display the value that the user picked.

What is being displayed in the textbox is the comboboxes first column, the
autonumber or column(0). when I changed the conttrol source of the text
box
to display column(1) I get "#Name?" in place where the name should be
displayed on the report. Wondering what I am doing wrong.

Scott
 
J

John W. Vinson

Her is the code attached to the field on my report:

=[OccDescription].[Column](1). When I preview the report all I get for a
value in that field is "Name?"

My combo Box name is OccDescription and it contains two values , the
autonumber assigned to each Occurence and the description of that occurence.
I have no issues with the form just with the report.

When I leave the control source at just OccDescription The value that comes
up on the report is the assigned number.

Am I doing something wrong.

Scott

If the combo box is on a Form and the textbox is on a Report, then you need to
explicitly reference the report:

=Forms![NameOfYourForm]![OccDescription].[Column](1)

Or, perhaps better, base the Report on a Query joining the combo box's
rowsource table to the report's current recordsource.
 
J

John W. Vinson

Her is the code attached to the field on my report:

=[OccDescription].[Column](1). When I preview the report all I get for a
value in that field is "Name?"

My combo Box name is OccDescription and it contains two values , the
autonumber assigned to each Occurence and the description of that occurence.
I have no issues with the form just with the report.

When I leave the control source at just OccDescription The value that comes
up on the report is the assigned number.

Am I doing something wrong.

Scott

If the combo box is on a Form and the textbox is on a Report, then you need to
explicitly reference the report:

=Forms![NameOfYourForm]![OccDescription].[Column](1)

Or, perhaps better, base the Report on a Query joining the combo box's
rowsource table to the report's current recordsource.
 

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

Top