P
PHisaw
Hi,
I have the following code for combo box on entry form:
Private Sub ContactNameCombo_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_ContactNameCombo_NotInList
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fContactList"
DoCmd.OpenForm stDocName, , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
Exit_ContactNameCombo_NotInList:
Exit Sub
Err_ContactNameCombo_NotInList:
MsgBox Err.Description
Resume Exit_ContactNameCombo_NotInList
End Sub
And I have the following code on the form "fContactList":
Private Sub Form_Load()
Me.ContactName = Me.OpenArgs
End Sub
The problem I run into is when I need to find an existing record to update.
Ex: Contact is already in list, but changes phone number or adds email
address. Is there a way to use code to keep from typing contact's name in
both the entry form and then again in the contact list when it opens (as it
is doing now - and works great!) AND be able to find existing record when
needed for updates. I was thinking something along the lines of a message
box that asks "Do you want to update contact info?" If yes, it opens the form
to the specific contact name for updating.
Any help is appreciated!!
Thanks,
Pam
I have the following code for combo box on entry form:
Private Sub ContactNameCombo_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_ContactNameCombo_NotInList
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fContactList"
DoCmd.OpenForm stDocName, , , , acFormAdd, acDialog, NewData
Response = acDataErrAdded
Exit_ContactNameCombo_NotInList:
Exit Sub
Err_ContactNameCombo_NotInList:
MsgBox Err.Description
Resume Exit_ContactNameCombo_NotInList
End Sub
And I have the following code on the form "fContactList":
Private Sub Form_Load()
Me.ContactName = Me.OpenArgs
End Sub
The problem I run into is when I need to find an existing record to update.
Ex: Contact is already in list, but changes phone number or adds email
address. Is there a way to use code to keep from typing contact's name in
both the entry form and then again in the contact list when it opens (as it
is doing now - and works great!) AND be able to find existing record when
needed for updates. I was thinking something along the lines of a message
box that asks "Do you want to update contact info?" If yes, it opens the form
to the specific contact name for updating.
Any help is appreciated!!
Thanks,
Pam