vbamania.pl
login:
hasło:
 
  *Rejestracja *Zapomniane hasło
 Dziś jest poniedziałek, 13 maja 2024 roku.
Ustaw jako stronę startową Ulubione Napisz
PowrótPowrót do serwisu  RegulaminRegulamin rssRSS

  tytuł wątku:
Wątki dyskusji

OpenQuery


otwartyotwarty rozpoczął: tedew postów: 2



napisał: tedew
postów: 19


umieszczony:
14 lipca 2005
15:25

  
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.
napisał: tedew
postów: 19


umieszczony:
14 lipca 2005
11:17

  
witam
jak otworzyć kwerende która wymaga parametrów uzywając metody OpenQuery ??

pozdr.


<-wstecz  1  dalej->
wszystkich stron: 1


Sortuj posty: z