Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    3

    Unhappy Unanswered: Select Query Datasheet Windows remain open after run


    Hi,
    I am trying to run a set of queries from an access form, the calculations work fine but I am left with 2 of the queries I ran left open in datasheet mode (both select queries).

    If anyone has any ideas how to stop this it would be appreciated. I guess this could be done by entering the queries directly into the code as SQL queries, is there any other ways?


    Cheers

    Trent

    Private Sub InputLitres_AfterUpdate()
    On Error GoTo Err_InputLitres_AfterUpdate

    Dim stDocName As String

    stDocName = "M_SetWarnings"
    DoCmd.RunMacro stDocName

    Me.Refresh

    stDocName = "Q_FuelCulmFilter"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

    stDocName = "Q_FuelCulm"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

    stDocName = "Q_FuelCulm2"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

    stDocName = "Q_FuelCulmTransferToMain"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

    Me.Refresh

    Exit_InputLitres_AfterUpdate:
    Exit Sub

    Err_InputLitres_AfterUpdate:
    MsgBox Err.Description
    Resume Exit_InputLitres_AfterUpdate

    End Sub

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    I think the other Queries are Action ons, so they did there job, but the 2 are SELECT ones, and therefor they stay opend.

  3. #3
    Join Date
    Apr 2004
    Posts
    3

    Thanks

    Thanks,
    I now realise what a silly question it was, this is my first real access project. I was under the impression that if I wanted to reference the query it had to run/ updated first.


Posting Permissions

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