so I have a search-as-you-typed form to search the customer first name and last name. Beside each name, there is an EDIT button where the user can click to open that particular case.
The customer could have more than one case.
The EDIT form consist of a main form (where it contains customer information) and a sub form which consist of the type of case and comment box.
Both the main form and sub form has its own table linked to it.
the problem right now is when the customer has more than one case, the EDIT form pulls up the first case of the customer even though it shows 3 in the search as you typed form.
I would like to have EDIT be opened to that particular case.
I do have this code under EDIT button:
Code:
Private Sub Command5_Click()
#If Not CC_Debug Then
On Error GoTo ErrProc
#End If
DoCmd.OpenForm "EditfrmAddNewMain", , , "AuditID=" & Me.txtMetricsID
DoCmd.Close acForm, "fdlgSearch", acSaveYes
ExitProc:
Exit Sub
ErrProc:
ErrMsg Err, Err.Description, Err.Source
Resume ExitProc
End Sub
and
Code:
Private Function SelectCus(ByVal lngStudyID As String)
DoCmd.OpenForm "EditfrmAddNewMain", , , "AuditID = " & Me.txtMetricsID
End Function
The code used to work. However, I think I did something and it is not working right and I can't figure it out.
PLEASE HELP!