using vba for action queries

pattyt

Registered User.
Local time
Today, 14:33
Joined
Aug 10, 2001
Messages
13
I have made 3 queries..the first one makes a table (HLPFILENEW) from an existing table (HLPFILE) where certain values are null...the 2nd query append records from the same existing table (HLPFILE) to my new made table (HLPFILENEW) with different criteria...the 3 query selects records from my (HLPFILENEW) for my reports...this is the code i have for the button..
dim stDocName As String

DoCmd.SetWarnings False
DoCmd.OpenQuery "OPENMYUNASGN1Q", acViewNormal, acEdit
DoCmd.OpenQuery "OPENMYUNASGN2Q", acViewNormal, acEdit
DoCmd.OpenQuery "OPENMYUNASGN3Q", acViewNormal, acEdit
DoCmd.Close acQuery, "OPENMYUNASGN3Q", acSaveYes

stDocName = "HLPCALLS_OPEN_MYTECHS"
DoCmd.OpenReport stDocName, acPreview
DoCmd.SetWarnings True

the thing is I have alot of users running this sometimes at the same time..I need to do these query's in vb code so it creates temp files for that person running it without inteferrring with each other...I don't know if I use qrydefs or tbldefs or how to do each one of these right after the other ...please help...
 
Patty:
Why not split the database into a front end and back end, that way the data is stored on the cental server and each indiviudal has the Queries, Forms, Reports, Modules and Macors on their local computer.

Search for splitting database in the help files.
 
You don't need to make a table to do this. You can base the report on a union query. Change your make table and append queries to plain select queries. Then change your third query (the recordsource for the report) to be a union query.

Select query1.*
From query1
Union Select query2.*
From query2;
 

Users who are viewing this thread

Back
Top Bottom