Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select a query windows (2003)

    I use a treeview to select some queries by clicking on the node. The code is:
    DoCmd.OpenQuery strDoc, varOpenDoc
    PositionFormOnRight

    Public Sub PositionFormOnRight()


    DoCmd.Restore
    DoCmd.MoveSize 630 * 5, 0, 630 * 19, 630 * 14.8

    End Sub

    The problem that I have is that the PositionOnRight procedure apply to the form with the treeview and not on the windows with the query results. How can I select the query windows before to call the PositionOnRight procedure.
    Thanks and regards,
    Marcel

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

    Re: Select a query windows (2003)

    I don't understand why PositionFormOnRight is applied to the form; the query should have the focus after it has been opened, and that is what happens when I test it. Try the following:

    DoCmd.OpenQuery strDoc, varOpenDoc
    DoCmd.SelectObject acQuery, strDoc
    PositionFormOnRight

    Note: end users should work with forms and reports only, never directly with tables or queries.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select a query windows (2003)

    I have tried and it works. I use the queries because I am the end user of this database and I apply directly the Pivot Chart to display the query that is a reporting sales query.
    Thank you and regards,
    Marcel

Posting Permissions

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