hey:)
próbowałem inaczej trochę ale nie działają obie metody
1 metoda
Dim dbs As Database
Dim qdf As QueryDef
Dim strSQL As String
Set dbs = CurrentDb
strSQL = "SELECT * FROM tblProduct where UAP='" &
Me.Kombi2.Value & "'"
Set qdf = dbs.CreateQueryDef("kwerenda", strSQL)
DoCmd.OpenQuery qdf.Name
Set dbs = Nothing
2 metoda
Dim dbs As Database, qdf As QueryDef, rst As Recordset
Set dbs = CurrentDb
Set qdf = dbs.CreateQueryDef("RangeOfOrders")
qdf.sql = "PARAMETERS [IMIE] CHAR; " & _
"SELECT * FROM Dane WHERE Imie=[Imie];"
qdf.Parameters("Imie") = "'Tomek'"
Set rst = qdf.OpenRecordset(dbOpenSnapshot)
rst.Close
Set dbs = Nothing
i w obydwu metodach wywala się w tym samym miejscu
Set qdf = dbs.CreateQueryDef(.....
a komunikat błedu jest taki
Object Variable or with Block variable not set
???
pozdr. |