Hi to all. It has been a long day and I am afraid my brain is fried so can I ask for the help of the forum?
On my form I have 26 command buttons A - Z and OnClick =FilterMyForm()
The code behind FilterMyForm is
I have Today, for the first time in several years of using this form got the error message
"The expression On Click you entered as the event property setting produced the following error:No Current Record"
I realise there is no error handling in my code and have tried to set up an error handler but to be honest am out of my depth. Can anyone show me how to set up an error handler to deal with the No Current Record issue.
Thanks
On my form I have 26 command buttons A - Z and OnClick =FilterMyForm()
The code behind FilterMyForm is
Code:
' The filtering on this form is in two parts, the "is like" and the "begins with".
' The "is like" is linked to Search2 which is an invisible text box in the form and "begins with" is linked to Search3.
' Search2 and 3 are criteria in the query for the subform.
' Search2 is updated via direct code in the "Change" part of the search text box and Search3 is updated via the code
' in FilterMyForm. The FilterMyForm could be direct coded into the onClick of the A-Z buttons but the
' Private Function negates the need for multiple coding
Private Function FilterMyForm()
' clear any criteria in the visible search box Search and hidden search box Search2.
Me.Search = ""
Me.Search2 = ""
' save the variable strFilter and apply it to Search3
Dim strFilter As String
strFilter = Screen.ActiveControl.Name
Search3.Value = strFilter
Me.frmIfSoilAnalResults.Requery
Me.frmIfSoilAnalResults.Form.Recordset.MoveFirst
End Function
I have Today, for the first time in several years of using this form got the error message
"The expression On Click you entered as the event property setting produced the following error:No Current Record"
I realise there is no error handling in my code and have tried to set up an error handler but to be honest am out of my depth. Can anyone show me how to set up an error handler to deal with the No Current Record issue.
Thanks