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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop-down List configuration

Status
Not open for further replies.

Dedicated

Programmer
Dec 26, 2003
38
US
I have a unbound drop-down list on my form with 8 columns. I'm using this form strictly for a resource tool. When I click the selected row all data should filter to the designated fields (8 fields). Problem: When I click on the selected row is automatically shows the 1st row of data, I can go down the list and select for it wont show up on the fields, only the first row will show. What am I doing wrong?

Thanks,
 
Care to explain in a little more details?

When you say click the selected row, are you talking about the row of the combobox?

When you say 1st row of data, do you mean first row of data on the form or combobox?
 
How are ya Dedicated . . . . .

A Combobox [blue]can only display one field![/blue] That field is the [blue]first non-zero width[/blue] in the [purple]Column Widths Property[/purple].

You can still access the other fields in code with:
Code:
[blue]Me!ComboBoxName.Column([purple][b]Idx[/b][/purple])[/blue]
Where [purple]Idx[/purple] is the Column Index of the field (zero based).

Calvin.gif
See Ya! . . . . . .
 
Dedicated

Objective said:
I have a unbound drop-down list on my form with 8 columns. I'm using this form strictly for a resource tool

Basically, it seems that you want to use the list box to easily display seleected data -- in your case, 8 fields or columns.

A typical way of using a list or combo box is to use the unbound control to fidn a record and then use a filter / recordset clone or other means to display the record on the form.

In fact, most of the time this approach is used, Access finds the Primary key which is selected from the list or control box, and then uses this key to find the record.

Create a form based on the eight or more fields you are working with. Create either unbound combo box or list box or boxes to perform each search.

For example, I have a support database that displays calls in a continous form. At the top, I have my filter buttons so I can search by period (month + year), date, tech, call type, etc. The search boxes are additive in that I can search for what I require with multiple criteria. For example, all work orders performed by this tech for Feb 2005.

The combo box or list box wizard will do the most of the work. Where the wizard runs into problems is...
- You want to retrieve a group of records. The Wizard will retrieve only one based on the primary key. The code has to be tweaked to accommodate this.
- You dont want to retrieve a record(s) based on the primary key. Similar issue to the above with a similar solution.

Post back if you have more questions.
 
I tend to use unbound forms. I use combobox to select the record and textbox using DLookup to display the information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top