Hi,
I have a reset button on my main form that when clicked should clear the main and subforms. Unfortunately, it is only clearing my main form. The code I have is:
The recordset for my subform is derived from the below code:
Thank you for your help
I have a reset button on my main form that when clicked should clear the main and subforms. Unfortunately, it is only clearing my main form. The code I have is:
Code:
Private Sub cmdReset_Click()
'Clear the criteria
Me!txtZipCode = vbNullString
Me!cboAssetNumber = vbNullString
Me!txtAddress1 = vbNullString
Me!txtCity = vbNullString
Me!txtState = vbNullString
Me![fsubProperties].Form.Refresh
Me![fsubProperties].Form.Filter = False
End Sub
The recordset for my subform is derived from the below code:
Code:
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As QueryDef
Set qdf = CurrentDb.QueryDefs("Get20Mile_SelQry")
qdf.Parameters(0) = Forms![frmMain]![txtZipCode]
Set rst = qdf.OpenRecordset(dbOpenDynaset)
Set [fsubProperties].Form.Recordset = rst
Thank you for your help