Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Combo box not showing data (Access XP)

    I have a problem where the Primary Contact appears as blank if the Customer Profile is Name 2, for all other Customer Profiles the Primary Contact appears ok. This happens when you press the next record button on the form I have provided in the DB.

    I have missed something but I am darned if I know.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo box not showing data (Access XP)

    I suspect your problem may be in the SQL populating the combobox. Do you see the same result if you don't try to filter the combobox?
    Charlotte

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

    Re: Combo box not showing data (Access XP)

    This is not specific to Name 2; any other customer profile than the one in the first record would show the same behavior. You need to requery the primary contact combo box in the On Current event of the form, to update the list part. Insert a line

    Me.PrimaryContactID.Requery

    in the Form_Current event. You should also clear the unbound grayed out text boxes if the corresponding combo box is null, for example

    Private Sub CustomerProfileID_AfterUpdate()
    If Not IsNull(CustomerProfileID) Then
    Me!TextAddress1 = Me!CustomerProfileID.Column(2)
    Me!TextAddress2 = Me!CustomerProfileID.Column(3)
    Me!TextAddress3 = Me!CustomerProfileID.Column(4)
    Me!TextAddress4 = Me!CustomerProfileID.Column(5)
    Me!TextCountry = Me!CustomerProfileID.Column(6)
    TextCustomerProfileID = Me!CustomerProfileID.Column(0)
    Else
    Me!TextAddress1 = Null
    Me!TextAddress2 = Null
    Me!TextAddress3 = Null
    Me!TextAddress4 = Null
    Me!TextCountry = Null
    TextCustomerProfileID = Null
    End If
    End Sub

    and similar for PrimaryContactID_AfterUpdate. To make sure this is also done from the Form_Current procedure, call CustomerProfileID_AfterUpdate and PrimaryContactID_AfterUpdate unconditionally, i.e. remove the Not IsNull tests for these.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Combo box not showing data (Access XP)

    Thanks Hans.
    The Requery did the trick.
    I will put the other code in as a matter of precaution.

Posting Permissions

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