Saving List Box and Combo Box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hiker68
    New Member
    • Apr 2010
    • 6

    #1

    Saving List Box and Combo Box

    Hello,
    I have a form that I can't figure out. It seems so easy, yet I am blank (long day!). I have a simple form where a name and address is added. I also have a combo box and a list box to select certain criteria (Organization and Department). When I save the information, the selections in the list box and the combo box are not saved when I retrieve the name.
    Do you have any suggestions? Here is my code to save the combo boxes.
    Code:
    Private Sub cboOrgID_AfterUpdate()
        cboOrgID.Requery
    End Sub
    Private Sub cboDeptID_AfterUpdate()
        cboDeptID.Requery
    End Sub
    And this is my save button
    Code:
    Private Sub cmdSave_Click()
        If Me.NewRecord Then
            MsgBox "The record has not yet been saved.  You must first save the record.", , "Record Not Yet Saved"
        Else
            If IsNull(cboContAddrID) Then
                gintAddressID = 0
                DoCmd.OpenForm "frmAddr", , , , acFormAdd, acDialog
                cboContAddrID.Requery
                If gintAddressID > 0 Then
                    Me.ContAddrID = gintAddressID
                End If
            Else
                Call SaveRecord
                MsgBox "Record has been Saved"
                gintAddressID = cboContAddrID
                DoCmd.OpenForm "frmAddr", , , "AddrID=" & GetAddrID(), , acDialog
            End If
            Me.Requery
        End If
    Thank you!
    Last edited by NeoPa; Apr 22 '10, 12:29 PM. Reason: Please use the [CODE] tags provided.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    I tried to work out what you meant by looking through your code, but little of that makes sense to me either.

    What exactly are we trying to help with here? Perhaps some example data may help if you can't make the question clearer.

    Comment

    Working...