combo box not in list trouble

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Slight problem. I have an unbound combo box and "not in list" code tied to
it...see below. The user goes in to add a new entry and gets the prompt to
add...it works but the screen doesn't refresh...meaning the user can click on
the new manufacturer but it shows a part under it (that's really tied to
another manufacturer). But close the form and open it then the new
manufacturer shows up with no parts tied (as it should be since there haven't
been parts added). How do I get it to show the new manufacturer and nothing
tied to it.

The combo box is in the detail and the parts pull in via a subform.



Private Sub Combo23_NotInList(NewData As String, Response As Integer)
Dim strSQL As String
Dim i As Integer
Dim Msg As String

'Exit this sub if the combo box is cleared
If NewData = "" Then Exit Sub

Msg = "'" & NewData & "' is not currently in the list." & vbCr & vbCr
Msg = Msg & "Do you want to add it?"

i = MsgBox(Msg, vbQuestion + vbYesNo, "Unknown Manufacturer...")
If i = vbYes Then
strSQL = "Insert Into tbl_manufacturer ([manufacturer]) " & _
"values ('" & NewData & "');"
CurrentDb.Execute strSQL, dbFailOnError
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub
.



Relevant Pages

  • RE: Add Record with combo box
    ... Private Sub JCTARSectionLayer1ID_NotInList(NewData As String, ... Response As Integer) ... Dim strMsg As String ... Dim rst As DAO.Recordset ...
    (microsoft.public.access.formscoding)
  • RE: Add Record with combo box
    ... Private Sub JCTARSectionLayer1ID_NotInList(NewData As String, ... Response As Integer) ... Dim strMsg As String ... Dim rst As DAO.Recordset ...
    (microsoft.public.access.formscoding)
  • RE: Combo Box and Limit To List
    ... Private Sub Requesting_Party_NotInList(NewData As String, Response As Integer) ... Dim mbrResponse As VbMsgBoxResult ...
    (microsoft.public.access.formscoding)
  • RE: Add Record with combo box
    ... Private Sub JCTARSectionLayer1ID_NotInList(NewData As String, ... Response As Integer) ... Dim strMsg As String ... Dim rst As DAO.Recordset ...
    (microsoft.public.access.formscoding)
  • Re: Help with modifing code??
    ... The following code in you userform's code module will sync the manufacturer's combobox cbxMfg with the product combobox cbxProd. ... Private Sub cbxMfg_Change ... Dim MfgName As String ... My database stores manufacturer names and their products, ...
    (microsoft.public.excel.programming)