OK! So far so good, but one error to clear up.
I have a form MainAddresses and a form OrgAddresses, when choosing an address from the lngAddressID field on frmOrgAddresses, if an address doesnt exist, I want to Double Click, add it to the main Address table, and my combo box.
For anyone who cares to know:
First I needed to handle how to
tell the user to double click an address field to add
a new address:
Option Compare Database
'Instruction on how to add new data.
Private Sub Combo10_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
Then I needed the actual code for the combo box,
which form to open, (Control Name left at Combo10
here for example.)
[code]'Code for Combo box.
Private Sub Combo10_DblClick(Cancel As Integer)
On Error GoTo Err_AddressID_DblClick
Dim lngAddressID As Long
If IsNull(Me![Combo10]) Then
Me![Combo10].Text = ""
lngAddressID = Me![Combo10]
Me![Combo10] = Null
DoCmd.OpenForm "frmMainAddress", , , , , acDialog, "GotoNew"
If lngAddressID <> 0 Then Me![Combo10] = lngAddressID
Then I needed code in the On Load event of the form to be opened. (GoToNew).
'Coded needed in the On Load Event of any form you want to add new data to.
Private Sub Form_Load()
If Me.OpenArgs = "GotoNew" And Not IsNull(Me![lngAddressID]) Then
DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70