AutoFill error

E

Esaw

Hi,
So I would like to be able to type in a number and have the description of
that number automatically displayed into the next field in a subform. This
information is stored in a table "Art"
What I've done is created a combo box for the number field "Style Number"
and I have looked through most of the discussions here and I've tried each
one that I've found. The Me.Style Number = Me.Style Description[Column](2)
and I also tried =[cboStyle Number].[Column](2)

My Combo Box Row Source is: SELECT [Art].[ArtID], [Art].[Style Number],
[Art].[Style Description] FROM Art ORDER BY [Style Number];

Each way I've tried to do this I get the #Name? error displayed in the field

Does someone know what I might be doing wrong?

I haven't been working with Access very long so an easy to follow answer
would help.

Thank you so much!
 
E

Esaw

No it was set to 1 So I then changed it to 3 now it is half working but it's
putting the description in the number field...not in it's own separate field.

Thanks for helping me

Ofer Cohen said:
Is the ColumnCount Property of the combo is 3, to specify 3 columns?

--
Good Luck
BS"D


Esaw said:
Hi,
So I would like to be able to type in a number and have the description of
that number automatically displayed into the next field in a subform. This
information is stored in a table "Art"
What I've done is created a combo box for the number field "Style Number"
and I have looked through most of the discussions here and I've tried each
one that I've found. The Me.Style Number = Me.Style Description[Column](2)
and I also tried =[cboStyle Number].[Column](2)

My Combo Box Row Source is: SELECT [Art].[ArtID], [Art].[Style Number],
[Art].[Style Description] FROM Art ORDER BY [Style Number];

Each way I've tried to do this I get the #Name? error displayed in the field

Does someone know what I might be doing wrong?

I haven't been working with Access very long so an easy to follow answer
would help.

Thank you so much!
 
E

Esaw

Thanks Al, I changed those couple control names I missed with the spaces.
I've entered everything in as you have it and I'm unable to select anything
from the combo box.
=[Art]![ArtID] This is the control source for StyleNumber
=[cboArtID].[Column](2) This is the control source on the unbound text box
And I have the columns set up just as you said in the Combo Box...
am I still missing something?

Al Campagna said:
Esaw,
It appears that you are incorrectly referring to your combo... or... not
bracketing your control name/s (that contain spaces) properly. Any control
name that contains spaces, referred to in code or a calcuulation, must be
bracketed. example = Me.[Style Number]
one that I've found. The Me.Style Number = Me.Style Description[Column](2)

As a general rule, don't use spaces in your control names.

Given a combobox named cboArtID, with 3 columns (ArtID, StyleNumber,
StyleDescription)
1. Bind cboArtID to the ArtID field in your table. (cboArtID
ControlSource equals ArtID)
2. Set up the combo with...
Columns = 3
ColumnWidths = 0" ; 1" ; 2"
ListWidth = 3"
What this will do is hide the ArtID from the user during selection, allow
the user to select an ArtID using just the StyleNumber and StyleDescription.
When a selection in cboArtID is made, the ArtID will be captured to the
bound ArtID field in your table... but the combo will still display the
StyleNumber to the user.
Now all we have to do is "display" the StyleDescripion in an unbound text
control on the form. A text control with a ControlSource of...
= cboArtID.Column(2)
will always "display" the StyleDescription.
*** Combo box columns are numbered 0, 1, 2, 3, etc...)***

In review, we've let the user select an ArtID using the StyleNumber and
StyleDescription...
We captured ArtID to the ArtID field...
We display the StyleNumber in cboArtID
We "display" the StyleDescription on the form by referencing the combo's
2nd column.

--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."



Esaw said:
Hi,
So I would like to be able to type in a number and have the description of
that number automatically displayed into the next field in a subform. This
information is stored in a table "Art"
What I've done is created a combo box for the number field "Style Number"
and I have looked through most of the discussions here and I've tried each
one that I've found. The Me.Style Number = Me.Style Description[Column](2)
and I also tried =[cboStyle Number].[Column](2)

My Combo Box Row Source is: SELECT [Art].[ArtID], [Art].[Style Number],
[Art].[Style Description] FROM Art ORDER BY [Style Number];

Each way I've tried to do this I get the #Name? error displayed in the
field

Does someone know what I might be doing wrong?

I haven't been working with Access very long so an easy to follow answer
would help.

Thank you so much!
 
O

Ofer Cohen

In the ControlSource of the text box write

=[ComboName].[Column](2)

Check the combo BoundColumn does it set to 1?
Also the column width property of the combo, that it display the first coulmn

--
Good Luck
BS"D


Esaw said:
No it was set to 1 So I then changed it to 3 now it is half working but it's
putting the description in the number field...not in it's own separate field.

Thanks for helping me

Ofer Cohen said:
Is the ColumnCount Property of the combo is 3, to specify 3 columns?

--
Good Luck
BS"D


Esaw said:
Hi,
So I would like to be able to type in a number and have the description of
that number automatically displayed into the next field in a subform. This
information is stored in a table "Art"
What I've done is created a combo box for the number field "Style Number"
and I have looked through most of the discussions here and I've tried each
one that I've found. The Me.Style Number = Me.Style Description[Column](2)
and I also tried =[cboStyle Number].[Column](2)

My Combo Box Row Source is: SELECT [Art].[ArtID], [Art].[Style Number],
[Art].[Style Description] FROM Art ORDER BY [Style Number];

Each way I've tried to do this I get the #Name? error displayed in the field

Does someone know what I might be doing wrong?

I haven't been working with Access very long so an easy to follow answer
would help.

Thank you so much!
 
E

Esaw

Nevermind I got it going. I changed the control source on the StyleNumber to
StyleNumber....it works.

Thanks so much for all your help everyone.

Esaw said:
Thanks Al, I changed those couple control names I missed with the spaces.
I've entered everything in as you have it and I'm unable to select anything
from the combo box.
=[Art]![ArtID] This is the control source for StyleNumber
=[cboArtID].[Column](2) This is the control source on the unbound text box
And I have the columns set up just as you said in the Combo Box...
am I still missing something?

Al Campagna said:
Esaw,
It appears that you are incorrectly referring to your combo... or... not
bracketing your control name/s (that contain spaces) properly. Any control
name that contains spaces, referred to in code or a calcuulation, must be
bracketed. example = Me.[Style Number]
one that I've found. The Me.Style Number = Me.Style Description[Column](2)

As a general rule, don't use spaces in your control names.

Given a combobox named cboArtID, with 3 columns (ArtID, StyleNumber,
StyleDescription)
1. Bind cboArtID to the ArtID field in your table. (cboArtID
ControlSource equals ArtID)
2. Set up the combo with...
Columns = 3
ColumnWidths = 0" ; 1" ; 2"
ListWidth = 3"
What this will do is hide the ArtID from the user during selection, allow
the user to select an ArtID using just the StyleNumber and StyleDescription.
When a selection in cboArtID is made, the ArtID will be captured to the
bound ArtID field in your table... but the combo will still display the
StyleNumber to the user.
Now all we have to do is "display" the StyleDescripion in an unbound text
control on the form. A text control with a ControlSource of...
= cboArtID.Column(2)
will always "display" the StyleDescription.
*** Combo box columns are numbered 0, 1, 2, 3, etc...)***

In review, we've let the user select an ArtID using the StyleNumber and
StyleDescription...
We captured ArtID to the ArtID field...
We display the StyleNumber in cboArtID
We "display" the StyleDescription on the form by referencing the combo's
2nd column.

--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."



Esaw said:
Hi,
So I would like to be able to type in a number and have the description of
that number automatically displayed into the next field in a subform. This
information is stored in a table "Art"
What I've done is created a combo box for the number field "Style Number"
and I have looked through most of the discussions here and I've tried each
one that I've found. The Me.Style Number = Me.Style Description[Column](2)
and I also tried =[cboStyle Number].[Column](2)

My Combo Box Row Source is: SELECT [Art].[ArtID], [Art].[Style Number],
[Art].[Style Description] FROM Art ORDER BY [Style Number];

Each way I've tried to do this I get the #Name? error displayed in the
field

Does someone know what I might be doing wrong?

I haven't been working with Access very long so an easy to follow answer
would help.

Thank you so much!
 

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