Hi all.
I have a notInList event on my main form that opens a popup form and parses the user's entry into the appropriate controls on that popup form. All works well EXCEPT:
IF the user makes changes to what was parsed into the popup form, usually that causes an error message when the "ok" button on the popup is clicked. The error message indicates that the name is 'not in the list', the text part of the combo box is blank, BUT the actual entry based on the modified values typed into the controls on the popup form IS available as a choice in the combobox.
Sometimes, depending on exactly what changes were made, these modified values are reflected BOTH in the dropdown list of the combo box AND in the text area of that combo box. I want the changes to ALWAYS be reflected like that so the error message doesn't come up and the user doesn't have to find the entry in the dropdown (or type it again).
Here's the notInList event code on my main form:
The popup form basically just has code behind the 'ok' command button 'on click' that makes the popup form invisible.
Can anyone see where the code is messed up and not properly getting ALL the changes made on the popup form to the original data typed in the main form combo box?
Changes that ARE properly reflected include: adding a middle initial (MI) when there wasn't one originally and adding letters to the first name when there is NOT a middle initial. Changes that are NOT reflected include ANY change made to the last name on the popup form, or additions to the first name when there's a pre-existing entry for MI.
I'm just stuck here. Any help would be greatly appreciated.
Thanks,
T
I have a notInList event on my main form that opens a popup form and parses the user's entry into the appropriate controls on that popup form. All works well EXCEPT:
IF the user makes changes to what was parsed into the popup form, usually that causes an error message when the "ok" button on the popup is clicked. The error message indicates that the name is 'not in the list', the text part of the combo box is blank, BUT the actual entry based on the modified values typed into the controls on the popup form IS available as a choice in the combobox.
Sometimes, depending on exactly what changes were made, these modified values are reflected BOTH in the dropdown list of the combo box AND in the text area of that combo box. I want the changes to ALWAYS be reflected like that so the error message doesn't come up and the user doesn't have to find the entry in the dropdown (or type it again).
Here's the notInList event code on my main form:
Code:
Private Sub Requesting_Party_NotInList(NewData As String, Response As Integer)
Dim mbrResponse As VbMsgBoxResult
Dim strMsg As String
On Error GoTo Requesting_Party_NotInList_Error
strMsg = "Add " & NewData & " as a new Party?"
mbrResponse = MsgBox(strMsg, vbYesNo + vbQuestion, "Invalid Party Name")
Select Case mbrResponse
Case vbYes
DoCmd.OpenForm "PopupContacts", DataMode:=acFormAdd, WindowMode:=acDialog, OpenArgs:=NewData
Me.Requesting_Party.Undo
If IsLoaded("PopupContacts") Then
Response = acDataErrAdded
DoCmd.Close acForm, "PopupContacts"
Else
Response = acDataErrContinue
End If
Case vbNo
Response = acDataErrContinue
End Select
Exit_Requesting_Party_NotInList:
Exit Sub
Requesting_Party_NotInList_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Requesting_Party_NotInList of VBA Document Form_Issues"
End Sub
The popup form basically just has code behind the 'ok' command button 'on click' that makes the popup form invisible.
Can anyone see where the code is messed up and not properly getting ALL the changes made on the popup form to the original data typed in the main form combo box?
Changes that ARE properly reflected include: adding a middle initial (MI) when there wasn't one originally and adding letters to the first name when there is NOT a middle initial. Changes that are NOT reflected include ANY change made to the last name on the popup form, or additions to the first name when there's a pre-existing entry for MI.
I'm just stuck here. Any help would be greatly appreciated.
Thanks,
T