Can't get Combo Box to Repopulate when Selecting Different Record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scookie
    New Member
    • Mar 2013
    • 1

    #1

    Can't get Combo Box to Repopulate when Selecting Different Record

    Here is my situation: I have frmSiteInfo(tbl Site) which holds my main surveysite data, and within each Site, you can have Surveys (frmSurveyInfo/tblSurvey) (which is a subform of frmSiteInfo on a new Tab), and Transects (fTransects/tblTransect), also a subform of frmSiteInfo on a new tab.

    The Transect data entered in fTransects is static for each individual site. There are always 8 transects per site.

    Within each frmSurveyInfo, there is subform fSubDistanceDat a(tblDistanceDa ta), that stores the individual counts and other data collected at each of the Transects. There can multiple surveys at each of the 8 transects. All I want to do is populate a combo box on my fSubDistanceDat a with the Transect#s and ID's that were entered on my fTransect form, so I can keep all of the transect data linked to my distance data. The form is in dataset view.

    I can set the row source for intTransectID on my fSubDistanceDat a form to tblTransectData .intTransectID and initially, it works fine. However, when I switch to a new Site, the combo box does not update. I have tried everything I can think of from requerying various forms, fields, combo boxes, creating recordsets, queries etc.

    I know it is a bit confusing, trust me, but any help would be appreciated.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Hard to say what's wrong without seeing the code.

    Comment

    • nico5038
      Recognized Expert Specialist
      • Nov 2006
      • 3080

      #3
      Did you try to use for the refresh after the switch:
      Code:
      Me.cmbX.recordsource = Me.cmbX.recordsource
      This will force Access to requery the combobox.

      Nic;o)

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        I can set the row source for intTransectID on my fSubDistanceDat a form to tblTransectData .intTransectID and initially
        This is where we will more than likely find your issue.
        Open the form to the control and the data tab. <ctrl><c> the value in the record source.
        Open this thread and in the "Post your reply" box, click on the [CODE/] button in the formatting toolbar.
        This will insert a pair of [CODE] [/CODE] tags.
        Now place the text cursor betwen those two tags and <ctrl><v> the information.

        Comment

        Working...