S
Steve
I have a client data table/form. To navigate to different client data forms,
I have created a combo-box on a pop-up form. When a last name is entered into
this field the selected client data form is opened and the pop-up form closes
(see code below). In situations where there are duplicate last names (for
example, there are several "Smiths" in the database) I would like to populate
a list box (DuplicateNames List Box) on the pop-up form with the list of
duplicate Names, DOB, CLient number from which the user can choose the
correct client. Any help would be greatly appreciated. Thanks.
Private Sub SearchLastName_AfterUpdate()
On Error GoTo SearchLastName_AfterUpdate_Err
If IsNull(Me![SearchLastName]) Then
response = MsgBox("You Did Not Select a Record to Search For", 32, "No
Record Selected")
Else
DoCmd.SelectObject acForm, "FrmClient"
DoCmd.GoToControl "ClientNumber"
DoCmd.FindRecord Me![SearchLastName]
DoCmd.GoToControl "Last Name"
SendKeys "{ESC}", True
DoCmd.Close acForm, "frmFindClient"
End If
Exit Sub
SearchLastName_AfterUpdate_Err:
MsgBox "Error is " & Error$, 16
Exit Sub
End Sub
I have created a combo-box on a pop-up form. When a last name is entered into
this field the selected client data form is opened and the pop-up form closes
(see code below). In situations where there are duplicate last names (for
example, there are several "Smiths" in the database) I would like to populate
a list box (DuplicateNames List Box) on the pop-up form with the list of
duplicate Names, DOB, CLient number from which the user can choose the
correct client. Any help would be greatly appreciated. Thanks.
Private Sub SearchLastName_AfterUpdate()
On Error GoTo SearchLastName_AfterUpdate_Err
If IsNull(Me![SearchLastName]) Then
response = MsgBox("You Did Not Select a Record to Search For", 32, "No
Record Selected")
Else
DoCmd.SelectObject acForm, "FrmClient"
DoCmd.GoToControl "ClientNumber"
DoCmd.FindRecord Me![SearchLastName]
DoCmd.GoToControl "Last Name"
SendKeys "{ESC}", True
DoCmd.Close acForm, "frmFindClient"
End If
Exit Sub
SearchLastName_AfterUpdate_Err:
MsgBox "Error is " & Error$, 16
Exit Sub
End Sub