Private Sub part_num_Click()
Dim strSQL As String
Dim strWhere As String
Dim i As Integer
i = 0
strSQL = "part_num = '" & Forms![frm_invt_main]![invt_main subform3].Form![part_num] & "'"
rs.MoveFirst
rs.Find (strSQL)
rs.FindFirst strSQL
any reference to rs here is triggering an errormessage. This code is in OnCilck event of "part_num" field of the subform of the main form: "frm_invt_main"
Thats because the Recordset is a public variable on the main form, and you are referencing it on the subform. A form level public variable is only visible within the form.
You could dimension the RS in a standard module making it global to the application. Or I think you can use the class name of the form. Something like
Form_MainForm.RS.Find(...)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.