i have main table called patients, and a form PtEntry
I have only bound textboxes and comboboxes there, so the data is entered separately
I guess I could make it unbound but that would be a lot of unnecessary work and would cause some problems.
I have a separate table called misc, where I store different data used for combobox lists. You can choose surgeon form the list or simply type a new one and it gets added to the list. Now I know how to do that for unbound boxes
If I do this to a bound combo, nothing happens.
Is it possible to do it like this? Am I missing something?
tx for help
I have only bound textboxes and comboboxes there, so the data is entered separately
I guess I could make it unbound but that would be a lot of unnecessary work and would cause some problems.
I have a separate table called misc, where I store different data used for combobox lists. You can choose surgeon form the list or simply type a new one and it gets added to the list. Now I know how to do that for unbound boxes
Code:
Private Sub txtSurg_NotInList(NewData As String, Response As Integer)
Dim strTmp As String
'Get confirmation that this is not just a spelling error.
strTmp = "Add '" & NewData & "' as new value for Surgeon?"
If MsgBox(strTmp, vbYesNo + vbDefaultButton2 + vbQuestion, "Not in list") = vbYes Then
'Append the NewData as a record in the Categories table.
strTmp = "INSERT INTO Misc ( Surg) " & _
"SELECT """ & NewData & """ AS Surg;"
DBEngine(0)(0).Execute strTmp, dbFailOnError
'Notify Access about the new record, so it requeries the combo.
Response = acDataErrAdded
End If
End Sub
If I do this to a bound combo, nothing happens.
Is it possible to do it like this? Am I missing something?
tx for help