Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012
    Posts
    33

    Unanswered: access 2007 / 2010 problems

    Hi. I have made a database with forms, query's and reports in access 2007. When I run it on access 2010 strange things happens.

    This is the problem:

    I have some queryes that sort out some records. I call these query from event on change from text boxes and combo boxes on a form. The problem is that it opens the query. I like to run this query in the background and then run a report based on this query.

    How to fix this.

    It works fine in access 2007 but not in access 2010.

    Thanks

  2. #2
    Join Date
    May 2012
    Posts
    33
    This is my code in on change event:

    Private Sub Combo165_Change()
    DoCmd.OpenQuery "System filter Query"
    Me.Combo165 = ""
    End Sub

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Several points:
    This type of code should be in the Control's AfterUpdate event, not the OnChange event. OnChange fires each time a character is entered into the Textbox or Combobox, and is inappropriate for this kind of thing.

    To set a Combobox back to a pre-selection, or Null state, don't set it to a Zero-Length String ("") use

    Me.ComboboxName = Null

    If you want a Report to run off of a Query you simply
    • Make the Query the Report's RecordSource
    • Run the Report

    There's no need to run the Query first!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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