Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access tables 1

Status
Not open for further replies.

7Oclock

Programmer
Mar 9, 2005
12
0
0
US
I want to display one field of a table in a combo box pulldown but want to write another field to the database. How do I do it?
 
Select both fields in the query, the hidden field first, then the display field. The set the boundcolumn to 1 and make the columnwidth of the hidden field 0" so the property looks like 0";1";

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Thanks VBslammer for the response. But I'm still not clear. Is the query you're referring to in the properties of the control on the form? Or in the query itself? Either way I don't see the boundcolumn and columnwidth properties. How do you edit the properties of the query fields?
 
Open your form in design mode and make sure the Properties window is open. ("View" -> "Properties")

Select the combo box. Then look at the "Data" tab in the "Properties" window.
RowSource will be a SELECT statement. For this example, will assume a Contact database...
SELECT ContactID, ContactName from tblContact


BoundColumn: 1 (This is ContactID, the first column in the SELECT statement)

Now select the "Format" tab in the "Properties" window.

ColumnCount: 2 (Matches number of columns in the SELECT statement, ContactID, ContactName)

ColumnWidths: 0";1.5" (zero length column is "hidden")

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top