I'm creating a small app that makes updates to a table based on user input. So I'm trying to open recordsets in a way that the Sub can see them every time the user inputs data. When I open the form and immediately close it I get a runtime error 91: "Object Variable or With block variable not set". It stops on the Bulk.Close line below.
I'm declaring Bulk as Public in the general declarations section then opening a recordset in Sub Form_Load. Is the error implying that I never created Bulk? What is the proper way to declare and open recordsets?
Code:
Private Sub Form_Unload(Cancel As Integer)
Bulk.Close
Code:
Option Compare Database
Public dabs As DAO.Database
Public Bulk As DAO.Recordset
Private Sub Form_Load()
Set dabs = CurrentDb
Set Bulk = dabs.OpenRecordset("Bulkpipe")
Bulk.Index = "idxBP_ID"