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!

combo box acting wierd

Status
Not open for further replies.

dj662003

Technical User
Dec 4, 2003
18
0
0
US
I have a conbo box in one of my subforms, its recordsource is my "products table". My problem is when I select one item from my combo box it changes all the records in the items field in my subform to that item. In other words, the field "items" on my subform wont hold the value of more than 1 item from my combo box.
 
How are ya dj662003 . . . . .

Is the [blue]items field[/blue] bound/unbound?

If [blue]items field[/blue] is bound, post the code for the combobox . . . .

Calvin.gif
See Ya! . . . . . .
 
dj662003

I have a conbo box in one of my subforms ... when I select one item from my combo box it changes all the records in the items field in my subform

It sounds like you have an unbound combo box in a contineous form. If the purpose of the combo box is to update a table ("products"), then you have to make sure the combo box is "bound" to the desired field.

Otherwise, you will have to provide more details on what you are attempting to do.

Richard
 
O.K. I Appologize for my lack of information here.
Here it goes,
The subform is on a Form (Orders) the point of the combo box is to select items from the "Items" Field in my "Products" Table, and display them on the orders form -
which will eventualy be the recordsource for a report that will be a invoice for my cutomers.

Thank you Ace, You were correct my combo box was not bound to my Items field. Now that it is bound to the correct field in my table I have run into another little issue.
Now after I have selected the items out of my combo box that I wish to be displayed in my subform, the combo box in the next field on my subform will not display the same item...Instead it will show a random number... once I select that number from the combo box it changes the item in my corresponding table to the number that was in my combo box??
I do have a relationship between my "Invoice Records" Table and my "Products" Table. The relationship characteristics are [one to many][primary key in products to foreign key invoice records][referential integrity is enforced]
Could this have anything to do w/ it?

I hope that there is enough here for you guys to chew on
thanx alot for all the help.

dj66

 
dj662003 . . . . .

[blue]willir[/blue] and I already surmised the CB and/or the [blue]items[/blue] control were unbound.

Any unbound textbox or combox in the detail section of the form cannot enumerate values since it not tied to the forms recordsource. This is why you get one value throughout all records.

To start fixing this, move the CB to the subforms [blue]header or footer[/blue] section. Then make it unbound again by removing any text in the [blue]ControlSource[/blue] property. Since the [blue]purpose of the CB is control of records displayed in the subform[/blue], it should be unbound.

Next the control for the [blue]items field[/blue]. According to your post origination this is the control that was duplicating. [blue]I was asking if this control was bound/unbound not the CB![/blue] If its part of the subforms [blue]recordSource[/blue] then by all means, make sure its bound!

This should take us back to a workable square one. Make a selection in the CB and let us know the results.

If problems persist, post the code for the CB.

Calvin.gif
See Ya! . . . . . .
 
DJ

Yep, a combo box can serve more than one purpose - for example, link a record from one table to another (bound), or be used as a filter to find specific records.

AceMan's solution is the correct way to apply the filter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top