I
inarobis
Hello Guys,
I have an error with this Form_open sub and I do not know why. The
error it is the error 91 (Object or Block variable not set) and the
line is the "Set qds = db.QueryDefs"
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database
Dim qds As DAO.QueryDefs
Dim qd As DAO.QueryDef
Dim strSql As String
Dim strName As String
'I get this value from another form
strName = Cstr(Me.OpenArgs)
'the candidate is a view
strSql = "Select [NAME] from dbo.Candidate where ([NAME] = '" & strName
& "');"
Set db = CurrentDb
Set qds = db.QueryDefs
Set qd = qds("dbo.Candidate")
qd.SQL = strSql
Set db = Nothing
End Sub
Someone can help me on that?
Ina
I have an error with this Form_open sub and I do not know why. The
error it is the error 91 (Object or Block variable not set) and the
line is the "Set qds = db.QueryDefs"
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database
Dim qds As DAO.QueryDefs
Dim qd As DAO.QueryDef
Dim strSql As String
Dim strName As String
'I get this value from another form
strName = Cstr(Me.OpenArgs)
'the candidate is a view
strSql = "Select [NAME] from dbo.Candidate where ([NAME] = '" & strName
& "');"
Set db = CurrentDb
Set qds = db.QueryDefs
Set qd = qds("dbo.Candidate")
qd.SQL = strSql
Set db = Nothing
End Sub
Someone can help me on that?
Ina