Unanswered: Re: referencing a control in the subform
I have main form and a subform. Within the subform I created a temp table use as the subform’s recordsource.
When the main form closes the temp table needs to be deleted. (This is working fine)
However if a recordset is not created or no temp table is not created I just want to close the forms without deleting the temp tbl.(The part is what I need to modify my code)
What I want to do is when cancel button is clicked in the main form I need to check if a field in the subform is populated, say bag_num but it is given the following error:
You entered an expression that has no value.
Private Sub cmdCancel_Click()
On Error GoTo Err_cmdCancel_Click
Dim str As String, ret_val As Integer
-->If Not IsNull(Me!start_inspection_list!bag_num.Value) Then
-->If Me!start_inspection_list!bag_num.Value <> "" Then
Error above occurs here
str = "DROP TABLE tblTmp_inspec;"
DoCmd.close acForm, "start_inspection"