Re: Add Values to Cascading Dropboxes
Have you considered using the event NotInList...?
Set theProperty "Only in list"(sorry this is from Italian translation...) in Data TAB Properties... to No(False), this will Fire the OnNotInList ComboBox Event when you digit a new code... here you cuold try to implement your Code to ADD the New Data...
On the OnLineHelp you could find this Sample
- Private Sub Colors_NotInList(NewData As String, _
- Response As Integer)
- Dim ctl As Control
-
- ' Return Control object that points to combo box.
- Set ctl = Me!Colors
- ' Prompt user to verify they wish to add new value.
- If MsgBox("Value is not in list. Add it?", _
- vbOKCancel) = vbOK Then
- ' Set Response argument to indicate that data
- ' is being added.
- Response = acDataErrAdded
- ' Add string in NewData argument to row source.
- ctl.RowSource = ctl.RowSource & ";" & NewData
- Else
- ' If user chooses Cancel, suppress error message
- ' and undo changes.
- Response = acDataErrContinue
- ctl.Undo
- End If
- End Sub
Display More
Just a suggestion... in your case, with RowSourceType="Table/Query"(not List Value as in Help Example)... to ADD a new Record, you could use a Action Query(Insert Into...) or open Recordset on RowSource and Add a NewData.
If the RowSource is a Read/Write Source, so if SQL Statement is Writable, you coud also use Recordset Obbject of Combo...
Finally you need to execute Requery Merthod on Combo...