R
Rosco
Can someone see my error in the following code. I get an "Access can't see query error on the OpenQuery command.
The query is built in the proper place, however.
Function RunQuery()
Dim wrkJet As Workspace, dbBackEnd As Database, qd As QueryDef, strPath As String, strFileNme As String
Dim sqlString As String
'DoCmd.SetWarnings False
strPath = "H:\Development\FolderName\"
strFileNme = "File_BE.mdb"
sqlString = "some sql to make table query string "
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbBackEnd = wrkJet.OpenDatabase(strPath & strFileNme)
With dbBackEnd
Set qd = .CreateQueryDef("qryQueryName", sqlString)
DoCmd.OpenQuery "qryQueryName", acViewNormal, acEdit
.QueryDefs.Delete qd.Name
End With
'DoCmd.SetWarnings True
End Function
Thanks for the Help
Rosco
The query is built in the proper place, however.
Function RunQuery()
Dim wrkJet As Workspace, dbBackEnd As Database, qd As QueryDef, strPath As String, strFileNme As String
Dim sqlString As String
'DoCmd.SetWarnings False
strPath = "H:\Development\FolderName\"
strFileNme = "File_BE.mdb"
sqlString = "some sql to make table query string "
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbBackEnd = wrkJet.OpenDatabase(strPath & strFileNme)
With dbBackEnd
Set qd = .CreateQueryDef("qryQueryName", sqlString)
DoCmd.OpenQuery "qryQueryName", acViewNormal, acEdit
.QueryDefs.Delete qd.Name
End With
'DoCmd.SetWarnings True
End Function
Thanks for the Help
Rosco