C
CS
The following Find Record code works fine when it's from a
standalone form but when it is from a subform I get the
error that the field 'ME_ID' does not exist. I'm thinking
that it's the form/subform reference but I don't know the
syntax. I appreciate any help with this problem, thanks.
-------------------------------------------
Dim strSampleRef As String
Dim strSearch As String
'Check txtSearch for Null value or Null Entry first.
If IsNull(Me![txtSearch]) Or (Me![txtSearch]) = "" Then
MsgBox "Please enter a value!", vbOKOnly, "Invalid Search
Criterion!"
Me![txtSearch].SetFocus
Exit Sub
End If
'Performs the search using value entered into txtSearch
and evaluates this against values in strSampleRef
DoCmd.ShowAllRecords
DoCmd.GoToControl ("ME_ID")
DoCmd.FindRecord Me!txtSearch
ME_ID.SetFocus
strSampleRef = ME_ID.Text
txtSearch.SetFocus
strSearch = txtSearch.Text
standalone form but when it is from a subform I get the
error that the field 'ME_ID' does not exist. I'm thinking
that it's the form/subform reference but I don't know the
syntax. I appreciate any help with this problem, thanks.
-------------------------------------------
Dim strSampleRef As String
Dim strSearch As String
'Check txtSearch for Null value or Null Entry first.
If IsNull(Me![txtSearch]) Or (Me![txtSearch]) = "" Then
MsgBox "Please enter a value!", vbOKOnly, "Invalid Search
Criterion!"
Me![txtSearch].SetFocus
Exit Sub
End If
'Performs the search using value entered into txtSearch
and evaluates this against values in strSampleRef
DoCmd.ShowAllRecords
DoCmd.GoToControl ("ME_ID")
DoCmd.FindRecord Me!txtSearch
ME_ID.SetFocus
strSampleRef = ME_ID.Text
txtSearch.SetFocus
strSearch = txtSearch.Text