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

Disappearing Combo Box Value

Status
Not open for further replies.
Apr 9, 2002
102
US
I have a combo-box that has a value, but after the after_update sub has run, the value turns to null. Here is a simplified version of my situation:

I have three tables. Table A, Table B, and a relationship table between the two that takes an id from each to make up its two primary keys. On the form, I am setting the recordset to a sql query that selects and inner joins all three (so I can pull descriptions from all three tables). The combo box is set to a sql query that selects just the ID from Table A. The problem that I am having is when I delete a relationship between Table A and Table B, the combo box turns to null. Any ideas as to why this is happening?? I am using Access 2000, I have solved the problem on Access XP, but if I take my form and move it back to Access 2000 it still does not work. Very odd.

Thanks ahead of time for any help you can give me.

P.S. I have stepped through my vb code and the value does not become null for the combo box until after I exit the combo boxes after update sub.

Marrow
 
Hi,

When you say 'delete relationship', do you mean that you delete the table B record?

If so, how is the relationship defined between Tables A & B?

It may be that BOTH must exist for Table A records to show.
(You do have 3 options for the relationship type).
---------------
If you are deleting the RELATIONSHIP in table design, then are you then running the form and physically clicking the combo to make sure no values are there?

I'll bet they are if the combo source is as you say, and it's just not keeping in sync. with the form data.

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Table A and Table B are both objects. Table C is the relationship table that keeps the many to many relationship between Table A and Table B. The form has 2 purposes. To show the information for the item selected in the combo box (from table A) and show details from the relationship table (table C) if they exist. When I select an item from the combo box and it has a relationship in Table C, then everything works perfectly. When I select an item in the combo box that has no relationship in Table C (But I still can view the details for this item populated from table A) the combo box decides to clear itself after the After_Update event runs (this value does not change as I step through the code, only after it exits the after_update sub). I am still baffeled. This combo box is linked only to Table A and so it should not be affected by the relationship table (Table C). Very odd.

Any help is much appreciated. Thanks.

Marrow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top