Geoff Codd
Registered User.
- Local time
- Today, 00:32
- Joined
- Mar 6, 2002
- Messages
- 190
Hi there,
I have the following code
Function RvS_Reports()
Dim vDBName As Variant
Dim vRvS_Exports
Dim vQuery As Variant
Dim vQuery1 As Variant
Dim sSQL1 As String
vDBName = "C:\RvS Reporting Reconciliation\BE_RvS_Exports.mdb"
Set vRvS_Exports = CurrentDb().OpenRecordset("tblRvS_Exports")
Do Until vRvS_Exports.EOF
DoCmd.OpenForm "frmPlease_Wait_Message", acNormal, "", "", acReadOnly, acNormal
DoCmd.RepaintObject acForm, "frmPlease_Wait_Message"
vQuery = "[" + vRvS_Exports!Query_Name + "]"
vQuery1 = "[" + vRvS_Exports!Query_Name + "]" + ".*"
'WONT WORK
sSQL1 = "SELECT """ & vQuery1 & """ " & _
" INTO """ & vQuery & """ " & _
" IN """ & vDBName & """ " & _
" FROM """ & vQuery & """ ;"
'WORKS
sSQL1 = "SELECT [qryQ2000_Reporting_Summary_(1)].* " & _
" INTO [qryQ2000_Reporting_Summary_(1)] " & _
" IN 'C:\RvS Reporting Reconciliation\BE_RvS_Exports.mdb'" & _
" FROM [qryQ2000_Reporting_Summary_(1)];"
DoCmd.RunSQL sSQL1
vRvS_Exports.MoveNext
Loop
vRvS_Exports.Close
DoCmd.Close acForm, "frmPlease_Wait_Message"
End Function
I cant' seem to get the SQL Statemnet to work, it is suppose to run the same statement for each query listed in a table.
Any ideas anyone.
Thanks is advance
Geoff
I have the following code
Function RvS_Reports()
Dim vDBName As Variant
Dim vRvS_Exports
Dim vQuery As Variant
Dim vQuery1 As Variant
Dim sSQL1 As String
vDBName = "C:\RvS Reporting Reconciliation\BE_RvS_Exports.mdb"
Set vRvS_Exports = CurrentDb().OpenRecordset("tblRvS_Exports")
Do Until vRvS_Exports.EOF
DoCmd.OpenForm "frmPlease_Wait_Message", acNormal, "", "", acReadOnly, acNormal
DoCmd.RepaintObject acForm, "frmPlease_Wait_Message"
vQuery = "[" + vRvS_Exports!Query_Name + "]"
vQuery1 = "[" + vRvS_Exports!Query_Name + "]" + ".*"
'WONT WORK
sSQL1 = "SELECT """ & vQuery1 & """ " & _
" INTO """ & vQuery & """ " & _
" IN """ & vDBName & """ " & _
" FROM """ & vQuery & """ ;"
'WORKS
sSQL1 = "SELECT [qryQ2000_Reporting_Summary_(1)].* " & _
" INTO [qryQ2000_Reporting_Summary_(1)] " & _
" IN 'C:\RvS Reporting Reconciliation\BE_RvS_Exports.mdb'" & _
" FROM [qryQ2000_Reporting_Summary_(1)];"
DoCmd.RunSQL sSQL1
vRvS_Exports.MoveNext
Loop
vRvS_Exports.Close
DoCmd.Close acForm, "frmPlease_Wait_Message"
End Function
I cant' seem to get the SQL Statemnet to work, it is suppose to run the same statement for each query listed in a table.
Any ideas anyone.
Thanks is advance
Geoff