Combo box on Forms

  • Thread starter Thread starter GSteven
  • Start date Start date
G

GSteven

I believe what I am trying to do is elementary but can't seem to get it
done.

OK, I have a single table called cust (example). There are 4 fields; name,
addr1, phone and city. I create a combo box on my form called 'cboCUST'
with the following (relevant, I think) properties;

Format:Column Count = 4
Column Width = 7";0";0";0"
Data:Control Source = "" (null or no value)
Input mask = ""
Row Source Type = "Table/Query"
Row Source = "select cust.name, cust.addr1, cust.phone, cust.city from
cust"
Bound Column = 1
Event:none set

This gives me a drop down menu from which I can select any one of my
customers.

What I want to do now is add the 3 other fields (text boxes) to my form in
random locations (to fit a pre-printed form) to show the other 3 values that
are related to the record that is chosen from the combo-box.

I placed a text box (named txtADDR) on the form and based on advice from an
earlier posting set the Control Source property to: "= Me!cboCUST.Column(1)"
which should correlate to the second field in my select statement.

When I open the form in view mode all I see in the text box is "#Name?". The
help for this error says that the MSOWF.DLL file is missing yet I find this
dll in the "c:\program files\Microsoft Office\Office" folder. What is this
"Me" function you are using and where can I find help on it? Any other
pointers or advice (other than hiring an Access developer, hehe)? What other
property values should I be considering to get this working?

tia
Steve

PS - sorry for the cross post. I started in the 'getting started' group but
thought this one was more relevant.
 
you should be able to open the field list from the form design toolbar and
just pull the required fields into your form .


I believe what I am trying to do is elementary but can't seem to get it
done.

OK, I have a single table called cust (example). There are 4 fields; name,
addr1, phone and city. I create a combo box on my form called 'cboCUST'
with the following (relevant, I think) properties;

Format:Column Count = 4
Column Width = 7";0";0";0"
Data:Control Source = "" (null or no value)
Input mask = ""
Row Source Type = "Table/Query"
Row Source = "select cust.name, cust.addr1, cust.phone, cust.city from
cust"
Bound Column = 1
Event:none set

This gives me a drop down menu from which I can select any one of my
customers.

What I want to do now is add the 3 other fields (text boxes) to my form in
random locations (to fit a pre-printed form) to show the other 3 values that
are related to the record that is chosen from the combo-box.

I placed a text box (named txtADDR) on the form and based on advice from an
earlier posting set the Control Source property to: "= Me!cboCUST.Column(1)"
which should correlate to the second field in my select statement.

When I open the form in view mode all I see in the text box is "#Name?". The
help for this error says that the MSOWF.DLL file is missing yet I find this
dll in the "c:\program files\Microsoft Office\Office" folder. What is this
"Me" function you are using and where can I find help on it? Any other
pointers or advice (other than hiring an Access developer, hehe)? What other
property values should I be considering to get this working?

tia
Steve

PS - sorry for the cross post. I started in the 'getting started' group but
thought this one was more relevant.
 
You can use the Column property of the combo to paste the data into controls
on your form. You can not set the combo as the ControlSource, a
ControlSource has to be a field in the form's RecordSource property, that is
a field in the table or query the form is based on.
The columns are in the order you select them for the RowSource property, but
be aware that the first column is number 0.
For example
Me.txtADDR = Me.cboCUST.Column (1)
BTW, Me is a shorthand for the form. You can use it instead of Forms!Myform

All of this is readily available in the Access help function.

Ragnar
 
Back
Top