Private Sub NameofCompany_AfterUpdate()
Dim StrSQL As String
Dim QDF As QueryDef
Dim CurrentDB As Database
StrSQL = "SELECT * FROM GeneralInformationTable;"
Me.List1.RowSource = StrSQL
Me.List1.Requery
Set QDF = CurrentDB.QueryDefs(TempQuery)
QDF.SQL = StrSQL
QDF.Close
End Sub
The above code is giving me an error message:
Run Time 91
Object variable or with block variable not set.
What am I doing wrong? :O(

Dim StrSQL As String
Dim QDF As QueryDef
Dim CurrentDB As Database
StrSQL = "SELECT * FROM GeneralInformationTable;"
Me.List1.RowSource = StrSQL
Me.List1.Requery
Set QDF = CurrentDB.QueryDefs(TempQuery)
QDF.SQL = StrSQL
QDF.Close
End Sub
The above code is giving me an error message:
Run Time 91
Object variable or with block variable not set.
What am I doing wrong? :O(