The data on my report doesn't update when I make a new selection in a combo box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lukesmith
    New Member
    • Jul 2013
    • 2

    #1

    The data on my report doesn't update when I make a new selection in a combo box

    I am using MS Access 2003 (I'm on an old pc).

    I have a report that takes data from a a table called 'tbl_AirlineCro ssSellingList'
    This data is then filtered down based on a selection made in a combo box 'cmb_CrossSelli ngList'.
    When the user clicks a button to preview the report the data does not change based on the selection?
    the query SQL code reads as follows;

    Code:
    SELECT tbl_AirlineXSL.Airline, tbl_AirlineXSL.[Airport Requesting], tbl_AirlineXSL.[Date Requested]
    FROM tbl_AirlineXSL
    WHERE (((tbl_AirlineXSL.Airline)=[Forms]![frm_Splashscreen]![cmb_CrossSellingList].[BoundColumn]));
    Please can someone tell me how I can make this work?
    Last edited by Rabbit; Jul 26 '13, 03:22 PM. Reason: Please use code tags when posting code.
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    Tray this. Add
    Code:
    if me.dirty then me.dirty = false
    at the top of your preview button click handler.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      The .BoundColumn property holds the column that is bound, it does not return the value of the column.

      Comment

      • lukesmith
        New Member
        • Jul 2013
        • 2

        #4
        jimtqsi.... The button uses the macro view in Access rather than the VBA view to run the macro, so I don't know how I would add that in?

        Rabit... When I remove the bound column property it says 'The Expression is typed incorrectly or it is too complicated to be evaluated...... .'
        The code now reads;
        Code:
        SELECT tbl_AirlineXSL.Airline, tbl_AirlineXSL.[Airport Requesting], tbl_AirlineXSL.[Date Requested]
        FROM tbl_AirlineXSL
        WHERE (((tbl_AirlineXSL.Airline)=[Forms]![frm_Splashscreen]![cmb_CrossSellingList]));

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #5
          lukesmith:

          A Few things:

          1) Not many of use use Macros, especially pre-2007 as they are very limited in what they can do.
          To verify that your control is using a macro:
          Please reopen the form in design view.
          Right click on the button
          In popup please select "properties "
          In the properties dialog, please select events tab
          In the on click event, please tell us what is there...
          If you are truely using a macro, then we may need that code. I have a little ditty I picked up somewhere that will send those to a text file that you can then open and cut and paste back to the thread.

          2)
          Rabit... When I remove the bound column property it says 'The Expression is
          Rabbit did not tell you to REMOVE the bound property.
          Rabbit was telling you that the value in the bound property will be the column to whit your control will return the value thereof.
          For Example:
          Code:
          SELECT tbl_AirlineXSL.Airline, tbl_AirlineXSL.[Airport Requesting], tbl_AirlineXSL.[Date Requested]
          Boundcolumn = 1 returns the value in tbl_AirlineXSL. Airline
          Boundcolumn = 2 returns the value in tbl_AirlineXSL.[Airport Requesting]
          etc...

          thnx

          Comment

          Working...