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!

One active record with Macro

Status
Not open for further replies.
Apr 23, 2002
39
US
The subject line doesn't explain this question well.

I have a table with several fields. One YES/NO field that indicates which is the active contest. I want only one record to be active at a time. I know I can do this with code, but I'm trying to use a macro to get this done. Here are my steps.

1. SetWarnings, NO
2. SetTempVar, MyTempVar, [Forms]![Contest Information]![ContestID]
3. RunSQL, UPDATE [Contest Information] SET [Contest Information].Active = False;,Yes
4. RunSQL, UPDATE [Contest Information] SET [Contest Information].Active = True WHERE ((([Contest Information].[ContestID])=[TempVars]![MyTempVar])), Yes
5. RunCommand, SaveRecord
6. SetWarnings, Yes

Works fine, but I get a write conflict warning when I save the record. Is there any easier way or am I making it harder than it is?

Thanks,
Don
 
Good luck, but FYI few people on this site bother with macros so you may not get many responses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top