G
George Papadopoulos
I am trying to access the Jet data engine using DAO. Specifically I have
attached an event handler to a button on a form. The code is shown below :
Private Sub List_spares_Click()
On Error GoTo Err_cmdGoHere_Click
Dim stDocName As String
Dim dbLib As DATABASE
Dim qdfSpares As QueryDef
' Set dbLib to the current database
Set dbLib = CurrentDb
' Create a query
Set qdfSpares = dbLib.CreateQueryDef("Spares",
"SELECT * FROM ANTALLAKTIKA WHERE [Kwdikos episkeyhs] = 2")
stDocName = "LISTA_ANTALLAKTIKWN"
DoCmd.OpenForm stDocName, OpenArgs:=Me.[Kwdikos_episkeyhs]
Exit_cmdGoHere_Click:
Exit Sub
Err_cmdGoHere_Click:
MsgBox Err.Description
Resume Exit_cmdGoHere_Click
End Sub
The code is supposed to execute a query and return a recordset which is to
be displayed in another form. The code fails starting at the statement :
Dim dbLib As DATABASE. Do I need to do something else before I can access
the jet database engine using DAO?
Thanks in advance
George Papadopoulos
attached an event handler to a button on a form. The code is shown below :
Private Sub List_spares_Click()
On Error GoTo Err_cmdGoHere_Click
Dim stDocName As String
Dim dbLib As DATABASE
Dim qdfSpares As QueryDef
' Set dbLib to the current database
Set dbLib = CurrentDb
' Create a query
Set qdfSpares = dbLib.CreateQueryDef("Spares",
"SELECT * FROM ANTALLAKTIKA WHERE [Kwdikos episkeyhs] = 2")
stDocName = "LISTA_ANTALLAKTIKWN"
DoCmd.OpenForm stDocName, OpenArgs:=Me.[Kwdikos_episkeyhs]
Exit_cmdGoHere_Click:
Exit Sub
Err_cmdGoHere_Click:
MsgBox Err.Description
Resume Exit_cmdGoHere_Click
End Sub
The code is supposed to execute a query and return a recordset which is to
be displayed in another form. The code fails starting at the statement :
Dim dbLib As DATABASE. Do I need to do something else before I can access
the jet database engine using DAO?
Thanks in advance
George Papadopoulos