Can someone help me debug the below code?
The code works until I get to the line "lstClaims.AddItem Qrys.Name", at which point I get an error message stating "Object Variable or With Block Variable not set".
A ListBox named lstClaims resides on the Form named "frmQry".
Thank you for any help.
Jim
Dim lstClaims As ListBox
Dim Qrys As Object
DoCmd.OpenForm "frmQry"
With CurrentData
For Each Qrys In .AllQueries
If Qrys.Name = "qryClaims" Then
lstClaims.AddItem Qrys.Name
End If
Next Qrys
End With
The code works until I get to the line "lstClaims.AddItem Qrys.Name", at which point I get an error message stating "Object Variable or With Block Variable not set".
A ListBox named lstClaims resides on the Form named "frmQry".
Thank you for any help.
Jim
Dim lstClaims As ListBox
Dim Qrys As Object
DoCmd.OpenForm "frmQry"
With CurrentData
For Each Qrys In .AllQueries
If Qrys.Name = "qryClaims" Then
lstClaims.AddItem Qrys.Name
End If
Next Qrys
End With