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!

Enable a Cascade update of tables Based on Windows ID in After Update

Status
Not open for further replies.

Fiat77

Programmer
Feb 4, 2005
63
US
I have a text box on my main form for a Claim Number. This field is the basis of seral 1 To Many Relationships in Tables in the database. What I need is in the After Update event for this Text Box, to enable a Cascade Update of all the Tables related to this claim number based on a specific Windows ID. I already have a module to capture the Windows User ID.

Example in AfterUpdate Event
If GetWindowsUser() = "jdoe" Then
allow for the cascade update of all related tables with that claim number
else do not allow cascade update

How can i do this? Thanks
 
I am confused by what you mean by run cascade update.
Is what you looking for perhaps running an update query

if so see docmd.runsql or openquery method-action

 
What i meant was that I wanted to what happens automatically when you check the box for Cascade Update in the Table relatiobships, BUT I just wanted to do it for one specific user. I did not want every user to have the ability to change a Claim number in the main Table and have those changes propagate to all related tables.

If there is a better way to do this using an update query I am up for any code suggestions.
 
cascade update is to assist in ensure your databases integrity. If you are not wanting it to do a cascade update for all users then an update query is certainly the way to go. With security you could limit their rights to the other tables but I am pretty sure there would be errors when it can't perform the required update.

Access help has excellent examples on update queries look that over an I have to beleive that is what you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top