I am making a function that opens a form and fills the text box with that number while also filtering the form
I have
Code:
Function filterSchoolPostCodes(FormName As Form, Postcode As String, FillField As control)
If Len(Postcode) <> 5 Or lenpostcode <> 4 Then
Else
Dim PostcodeConverted As Integer
PostcodeConverted = CInt(postcodefield)
DoCmd.OpenForm (FormName), , , "[numberInt] between " & (PostcodeConverted + 5) & " And " & (PostcodeConverted - 5) & ""
Forms!(FormName).Form.FillField.Value = PostcodeConverted
End If
End Function
Private Sub PostCode_DblClick(Cancel As Integer)
Call filterSchoolPostCodes(frmSchoolsSearchPostCode, Me.Postcode, txtPostCode)
End Sub
What I don't know is how to correctly reference the formname and the textbox on the field in my code.
any recommendations?