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

Form

Status
Not open for further replies.

Emario

MIS
Aug 6, 2001
39
0
0
US
I have an Access 2000 budget database form. I have some combo boxes (2) pulling data from a main combo box. The first box is puling in the budget name from the account number. The second is pulling in the budgetype. However for each budget name there is more than one type for example. Travel has types training, meeting, conference etc. But what happens is the box only pulls the first item in the training budgettype. What I woould like to do is have the box fill dynamically with all the type that match the account number. I know it can be done a variety of way with VB but I don't have that knowledge is there any way to pull data into a combo box and group it based on another combo box. Or is anyone has some code that I can play around that might get this done. Thanks in advance
 
In the BudgetType combo Properties table set the RowSourceType to Table/Query. Now place the curor in the RowSource field and click the build button ( the one with three dots ... on it). This will open a query design grid. Add the table which contains the list of BudgetTypes and add to the first (leftmost) query column: AccountNumber and in the second column BudgetType.

In the Criteria section of the left column type:

[Forms]![YourFormname]![AccountnameCombo]

Now you can click the close button and click yes to save the design back to the combobox, or you can save the design as a Query: click the file menu and SaveAs.

Obviously you need to correct this for your actual naming conventions.

Rod
 
Thanks for the response. But now my combo is blank.
 
Check that the Select statement in the RowSource property field actually produces some data: click the build button to open the query grid displaying the fields that you selected. Now click on the View button to see what data the SELECT query is generating.

If that is satisfactory, note the number of columns displaying data and note the position of the column which has the data item you want the combo box to be bound to and which columns you want the combo box to display when the list drops. The combo box doesn't necessarily have to display the bound column. Click close and save if requested.

Now check the following properties for the combo box, that they match the above items.

Bound column; Column Count; Columns Widths; and List Width.

List Width must be >= Columns Widths

Basically, if the SELECT statement, as constructed by the query grid, generates a suitable data list then the combo box settings mentioned are all that will prevent it from displaying the information.

If you still can't get it to work come back and show me the Select statement and the values you have in the Property fields mentioned above.

Rod
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top