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

Changing a foreign key in form based on query linking tables

Status
Not open for further replies.

herbivorous

Technical User
Mar 28, 2002
32
US
Is that a helpful header?

Here's my issue -- I've got a form which is based on a query linking three tables: People linked to Organizations linked to Addresses (each Org may have multiple addresses.) If you change the Organizations (via combo box), I want the Address information to then clear. So I need to set AddressID to null. I tried to do this directly via VBA setting People.AddressID = Null, but I kept getting errors, which I guessed were based on the fact that this was holding other information in the query.

So I attempted to run an SQL query to change the record in the underlying People table. Great idea, except I get a pop-up asking me to react to "other users" having changed the information, and have to select the non-intuitive "drop changes" to have the procedure do what it should. SetWarnings has no effect on the pop-up. One non-elegant solution would be to have the form hop over to another record for a sec while it runs the SQL, but there has got to be a better way.

Any suggestions on either failed attempt to address the problem? (Can I change a linking field in a query to null without upsetting the "Great Balance"?)

Thanks

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top