scouser
Registered User.
- Local time
- Today, 14:02
- Joined
- Nov 25, 2003
- Messages
- 767
I have a form 'frmOrders' with a sub form 'frmOrderDetails'. On the sub form I have a combo 'cboMake'. If the user enters a Vehicle Make that does not exist the following code is run:
So now frmMakes is open. This allows the user to enter the vehicle Make that was not in the list. The user then clicks a command button to return to the Orders Form. The On_Click event of this command is as follows:
So now the user is returned to the Orders Form. However the Vehicle Make he just entered does not appear in the list unless he naviagtes away from the record and back again?
Any ideas on how after closing the frmMakes the newly entered record appears in the cboMakeID?
Thanks in advance,
Phil.
Code:
Private Sub cboMakeID_NotInList(NewData As String, Response As Integer)
DoCmd.OpenForm "frmMakes", acNormal, , , acFormEdit, acWindowNormal
DoCmd.GoToRecord , , acNewRec
DoCmd.Close acForm, Me.Name
End Sub
So now frmMakes is open. This allows the user to enter the vehicle Make that was not in the list. The user then clicks a command button to return to the Orders Form. The On_Click event of this command is as follows:
Code:
Private Sub cmdReturnToOrderForm_Click()
On Error GoTo Err_cmdReturnToOrderForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOrders"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, Me.Name
Exit_cmdReturnToOrderForm_Click:
Exit Sub
Err_cmdReturnToOrderForm_Click:
MsgBox Err.Description
Resume Exit_cmdReturnToOrderForm_Click
End Sub
So now the user is returned to the Orders Form. However the Vehicle Make he just entered does not appear in the list unless he naviagtes away from the record and back again?
Any ideas on how after closing the frmMakes the newly entered record appears in the cboMakeID?
Thanks in advance,
Phil.