I have a form called "frmNewTicketEntry", normally user selects the customer from a combo box.
I'm trying to give them the ability to type in a phone#, in the AFTERUPDATE event of the phone# control, I have it opening a POPUP form with a listbox that represents any customers that have that phone# in any of the Phone # fields (Cell, Work, Home, etc...)
When it opens the popup, it sets which form it came from in an unbound control called FROMFORM, (doing this in case I want to use same phone search method on other forms)
All good so far.
But when the user selects the right Customer from the list box and clicks the OK button, I want it to close the POPUP and set all of the necessary fields back on frmNewTicketEntry form.
My problem seems to be that frmNewTicketEntry isn't getting FOCUS. I must be missing something simple, pretty sure I've accomplished this before.
thanks for any help.
This is the code that runs from Command button on popup form..............
Dim stCust As String
Dim stFromForm As String
stCust = Me.SearchList.Value
stFromForm = Me.FromForm.Value
DoCmd.Close acForm, "frmDialogPhoneLU"
DoCmd.SelectObject acForm, stFromForm, False
Dim stAddr As String
Dim stCity As String
Dim stState As String
Dim stZip As String
stAddr = Nz(DLookup("[Addr1]", "tblContacts", "[Numb] = " & stCust), "")
stCity = Nz(DLookup("[City]", "tblContacts", "[Numb] = " & stCust), "")
stState = Nz(DLookup("[State]", "tblContacts", "[Numb] = " & stCust), "")
stZip = Nz(DLookup("[Zip]", "tblContacts", "[Numb] = " & stCust), "")
Me.Address.Value = stAddr
Me.CityStateZip.Value = stCity & " " & stState & " " & stZip
Me.CustNo.Enabled = False
Me.Address.Enabled = False
Me.CityStateZip.Enabled = False
me.phone.Enabled = False