B
Bonnie
Hi,
I am running multiple queries to merge/purge/clean up data. I would like to
string the different events in a vba script but I'm not sure how to pause
between events. For example, I run a query that deletes the old data,
another that copies new data from source, another that copies data from
another source, then a query that pulls up records with missing data elements
- which I would like to stop at so I can look at and fix or make decisions
on. Then I have the next query or a report, etc.
Can any one tell me a good way to pause so I can finish with one query
before going on the next. I did this with a macro and then converted it to
VBA as below:
DoCmd.SetWarnings False
If (MsgBox("Are you sure?", 1) <> 1) Then
Exit Function
End If
' Zap liens.
DoCmd.OpenQuery "ZAPRECS", acViewNormal, acEdit
' Zap Updebtor
DoCmd.OpenQuery "ZapUpDebtor", acViewNormal, acEdit
' Zap Upsecured
DoCmd.OpenQuery "ZapUpSecured", acViewNormal, acEdit
' Append 19D
DoCmd.OpenQuery "19dAppend", acViewNormal, acEdit
' Append ADM
DoCmd.OpenQuery "AdmAppend", acViewNormal, acEdit
' Append Keydata
DoCmd.OpenQuery "AppendKeydata", acViewNormal, acEdit
' Query to check for missing elements
DoCmd.OpenQuery "CkBlanks", acViewNormal, acEdit
' Delete records with REASON filed in (not keyed)
DoCmd.OpenQuery "DelReason", acViewNormal, acEdit
' Query to get keyer counts (print)
DoCmd.OpenQuery "KeyerCount", acViewNormal, acEdit
' DB1Upload - copy debtors to updebtor table
DoCmd.OpenQuery "DB1Upload", acViewNormal, acEdit
' DB2Upload - copy co-debtors to updebtor table
DoCmd.OpenQuery "DB2Upload", acViewNormal, acEdit
' PL1Upload - copy secured party to upsecured table
DoCmd.OpenQuery "PL1Upload", acViewNormal, acEdit
' back up liens to C:\images\oldzips\sentbk.dbf (overwrites)
DoCmd.TransferDatabase acExport, "dBase 5.0", "c:\images\OLDZIPS",
acTable, "Liens", "SentBK.dbf", False
' Run upload report.
DoCmd.OpenReport "UCC Upload Report", acViewPreview, "", "", acNormal
Thanks in advance.
Bonnie
I am running multiple queries to merge/purge/clean up data. I would like to
string the different events in a vba script but I'm not sure how to pause
between events. For example, I run a query that deletes the old data,
another that copies new data from source, another that copies data from
another source, then a query that pulls up records with missing data elements
- which I would like to stop at so I can look at and fix or make decisions
on. Then I have the next query or a report, etc.
Can any one tell me a good way to pause so I can finish with one query
before going on the next. I did this with a macro and then converted it to
VBA as below:
DoCmd.SetWarnings False
If (MsgBox("Are you sure?", 1) <> 1) Then
Exit Function
End If
' Zap liens.
DoCmd.OpenQuery "ZAPRECS", acViewNormal, acEdit
' Zap Updebtor
DoCmd.OpenQuery "ZapUpDebtor", acViewNormal, acEdit
' Zap Upsecured
DoCmd.OpenQuery "ZapUpSecured", acViewNormal, acEdit
' Append 19D
DoCmd.OpenQuery "19dAppend", acViewNormal, acEdit
' Append ADM
DoCmd.OpenQuery "AdmAppend", acViewNormal, acEdit
' Append Keydata
DoCmd.OpenQuery "AppendKeydata", acViewNormal, acEdit
' Query to check for missing elements
DoCmd.OpenQuery "CkBlanks", acViewNormal, acEdit
' Delete records with REASON filed in (not keyed)
DoCmd.OpenQuery "DelReason", acViewNormal, acEdit
' Query to get keyer counts (print)
DoCmd.OpenQuery "KeyerCount", acViewNormal, acEdit
' DB1Upload - copy debtors to updebtor table
DoCmd.OpenQuery "DB1Upload", acViewNormal, acEdit
' DB2Upload - copy co-debtors to updebtor table
DoCmd.OpenQuery "DB2Upload", acViewNormal, acEdit
' PL1Upload - copy secured party to upsecured table
DoCmd.OpenQuery "PL1Upload", acViewNormal, acEdit
' back up liens to C:\images\oldzips\sentbk.dbf (overwrites)
DoCmd.TransferDatabase acExport, "dBase 5.0", "c:\images\OLDZIPS",
acTable, "Liens", "SentBK.dbf", False
' Run upload report.
DoCmd.OpenReport "UCC Upload Report", acViewPreview, "", "", acNormal
Thanks in advance.
Bonnie