Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Oct 2003
    Location
    Guelph, Ontario, Canada
    Posts
    428
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding to Value List (2000 all updates)

    I have a frmPatInfo, based on tblClinic2005. On that main form is a subform frmVisits, based on tblVisits.

    On the subform is a combo box

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Adding to Value List (2000 all updates)

    If the Row Source Type of the combo box is Value List, you can't add items permanently. You must store the names of the insurance companies in a table, and change the Row Rource Type of the combo box to Table/Query. You can then use the On Not In List event to add a record to the table. You can find examples in this forum.

  3. #3
    4 Star Lounger
    Join Date
    Oct 2003
    Location
    Guelph, Ontario, Canada
    Posts
    428
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding to Value List (2000 all updates)

    Hans
    Thanks. Things are working fine now. I built a table and form, and then put this code found in other examples...

    Private Sub cboIns_NotInList(NewData As String, Response As Integer)
    If MsgBox("Insurance Company is not in the list." & vbCrLf & "Add it?", _
    vbYesNo + vbQuestion, "Add New Record") = vbYes Then
    DoCmd.OpenForm FormName:="frmInsurance", DataMode:=acFormAdd, WindowMode:=acDialog, OpenArgs:=NewData
    Response = acDataErrAdded
    Else
    cboIns.Undo
    Response = acDataErrContinue
    End If
    End Sub

    And then I put this code on the Load event of frmInsurance...
    Private Sub Form_Load()
    If Not IsNull(Me.OpenArgs) Then
    Me.InsCo = Me.OpenArgs
    End If
    DoCmd.Close
    End Sub

    Thanks again, Hans.

    Tom

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •