Hi
I have a combo box which holds client information. When I type ina word notinlist it prompts me to say it is not in the list (as per code below)..
When i go to add the new client and then go back to the quote screen the new customer is not displayed. If I close the quote form completely and then go back in the information is in the combo box...
I tried adding the close command into the code but this just goes in a loop and then ends up with a debug problem...
So how can I change the code so it works and close the form or is there another way to update the combo box from the client table when adding the new record????
If I can close, in the client form perhaps I could put a button to go back to the quote form.... using docmd close and open..... is it possible then when it opens to go to the lastrecord then? Thanks....
Private Sub Combo44_NotInList(NewData As String, Response As Integer)
ans = MsgBox("This account is not on your Clients List. Do you want to add this account ?", vbYesNo, "Asbestos Surveyors Quote Message ?")
If ans = vbNo Then
qclientid = Null
Else
stDocName = "subformclient"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "formquote", acSaveYes
End If
End Sub
I have a combo box which holds client information. When I type ina word notinlist it prompts me to say it is not in the list (as per code below)..
When i go to add the new client and then go back to the quote screen the new customer is not displayed. If I close the quote form completely and then go back in the information is in the combo box...
I tried adding the close command into the code but this just goes in a loop and then ends up with a debug problem...
So how can I change the code so it works and close the form or is there another way to update the combo box from the client table when adding the new record????
If I can close, in the client form perhaps I could put a button to go back to the quote form.... using docmd close and open..... is it possible then when it opens to go to the lastrecord then? Thanks....
Private Sub Combo44_NotInList(NewData As String, Response As Integer)
ans = MsgBox("This account is not on your Clients List. Do you want to add this account ?", vbYesNo, "Asbestos Surveyors Quote Message ?")
If ans = vbNo Then
qclientid = Null
Else
stDocName = "subformclient"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "formquote", acSaveYes
End If
End Sub