brastedhouse
New member
- Local time
- Yesterday, 23:28
- Joined
- Apr 13, 2016
- Messages
- 8
good morning, i am trying to requery a combox based on a multi-value field for a not-in-list situation. i usually add to the list as:
i cannot use this in a combo box based on a multi-value field because it will not autofill. you have to manually check each choice. so I use a form to add the record to the table. the update works, but the requery will not. i can close the form and reopen it and get the new record, but no permuation of requery will update the list in the combo box.
i have tried Forms!Formname!Comboboxname.requery in several locations in the code to no avail.
does anyone have any experience in multivaue fields and requery? can requery work on a combo box with a multi-value field?
Thanks, Scott
Code:
Dim intAnswer As Integer
Dim strSQL As String
intAnswer = MsgBox("The location " & Chr(34) & NewData & _
Chr(34) & " is not currently listed." & vbCrLf & _
"Would you like to add it to the list now?" _
, vbQuestion + vbYesNo, "CFD Operations")
If intAnswer = vbYes Then
strSQL = "INSERT INTO tblCallsLocationsLU([callLocation],[callDrill]) VALUES ('" & NewData & "', 1);"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
MsgBox "The new location has been added to the list.", vbInformation, "CFD Operations"
Response = acDataErrAdded
DoCmd.SetWarnings True
Else
MsgBox "Please choose a location from the list.", vbInformation, "CFD Operations"
Response = acDataErrContinue
End If
i cannot use this in a combo box based on a multi-value field because it will not autofill. you have to manually check each choice. so I use a form to add the record to the table. the update works, but the requery will not. i can close the form and reopen it and get the new record, but no permuation of requery will update the list in the combo box.
i have tried Forms!Formname!Comboboxname.requery in several locations in the code to no avail.
does anyone have any experience in multivaue fields and requery? can requery work on a combo box with a multi-value field?
Thanks, Scott