A
Anthony
Hello there.
I have a form which contains 9 combo boxes arranged as shown below:
Problem No. 1:
OperationType1
OperationSubtype1
PartOfBody1
Problem No. 2:
OperationType2
OperationSubtype2
PartOfBody2
Problem No. 3:
OperationType3
OperationSubtype3
PartOfBody3
I want to be able to add new values to each of these combo boxes, so that if
I add a value to OperationType1, for example, the value list in
OperationType2 and OperationType3 will also be updated.
I have created event procedures in OnNotInList for each of these combo boxes
(and have also set the Limit to List value to "yes") and the code is shown
below:
Private Sub OperationType_NotInList(NewData As String, Response As Integer)
Dim ctl As Control
Set ctl = Me!OperationType
Set ctlA = Me!Combo22
Set ctlB = Me!Combo38
If MsgBox("This operation is not in the list. Do you want to add it to
the list ?", _
vbOKCancel) = vbOK Then
Response = acDataErrAdded
ctl.RowSource = ctl.RowSource & ";" & NewData
ctlA.RowSource = ctlA.RowSource & ";" & NewData
ctlB.RowSource = ctlB.RowSource & ";" & NewData
Else
Response = acDataErrContinue
ctl.Undo
End If
End Sub
This event procedure successfully adds the new values to the value list for
each of the required combo boxes, but these values only exist on these value
lists while the form is open. Once I close the form, the new values
disappear from the value list.
Any suggestions as to how I can retain new values on the value list once
they are entered?
Thanks in advance
Anthony
I have a form which contains 9 combo boxes arranged as shown below:
Problem No. 1:
OperationType1
OperationSubtype1
PartOfBody1
Problem No. 2:
OperationType2
OperationSubtype2
PartOfBody2
Problem No. 3:
OperationType3
OperationSubtype3
PartOfBody3
I want to be able to add new values to each of these combo boxes, so that if
I add a value to OperationType1, for example, the value list in
OperationType2 and OperationType3 will also be updated.
I have created event procedures in OnNotInList for each of these combo boxes
(and have also set the Limit to List value to "yes") and the code is shown
below:
Private Sub OperationType_NotInList(NewData As String, Response As Integer)
Dim ctl As Control
Set ctl = Me!OperationType
Set ctlA = Me!Combo22
Set ctlB = Me!Combo38
If MsgBox("This operation is not in the list. Do you want to add it to
the list ?", _
vbOKCancel) = vbOK Then
Response = acDataErrAdded
ctl.RowSource = ctl.RowSource & ";" & NewData
ctlA.RowSource = ctlA.RowSource & ";" & NewData
ctlB.RowSource = ctlB.RowSource & ";" & NewData
Else
Response = acDataErrContinue
ctl.Undo
End If
End Sub
This event procedure successfully adds the new values to the value list for
each of the required combo boxes, but these values only exist on these value
lists while the form is open. Once I close the form, the new values
disappear from the value list.
Any suggestions as to how I can retain new values on the value list once
they are entered?
Thanks in advance
Anthony