Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    38

    Wink Unanswered: using DoCmd.Open Query

    Instead of using DoCmd.OpenQuery command to open the query, is there any other code we can use?

    I tried to use some ADO codes like command.text, command.execute but it will not prompt out the result window, only refresh the screen once.

    Thanks in advance.

  2. #2
    Join Date
    Mar 2004
    Location
    Slovenia
    Posts
    56

    ?

    I don't quite understand your question,...

    1.assumption : you just don't like docmd.openquery // openquery provides correct result
    2.assumption: you need to see the results of a query on demand

    Suggestion: Make another form based on your and show results with proper command.
    Back to the basics...

  3. #3
    Join Date
    Mar 2004
    Location
    Slovenia
    Posts
    56
    Suggestion: Make another form based on your query and show results with proper command.
    Back to the basics...

  4. #4
    Join Date
    Jul 2004
    Posts
    38

    Wink

    Thanks your reply first.

    I've a textbox and a button on the form. After input the keywords in the textbox and click on the button, a query result will be shown (prompt out a new window) based on the keyword in textbox.

    I used to write Docmd.openquery "xxx" in the button_click event, and it's also work. But Is there anyother code do the same thing? (using ADO code)?

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by RaymondTse
    Thanks your reply first.

    I've a textbox and a button on the form. After input the keywords in the textbox and click on the button, a query result will be shown (prompt out a new window) based on the keyword in textbox.

    I used to write Docmd.openquery "xxx" in the button_click event, and it's also work. But Is there anyother code do the same thing? (using ADO code)?
    HI Raymond,

    What I use is this: CurrentDB.Execute
    Code:
    stDocName = "LaunchPad.PostJobCharge"   
        CurrentDb.Execute "PostJobCharge"    'This is a Query.
        CurrentDb.Execute "UpdateStockedItems"   'This is a Query.
    This runs two queries actually.....PostJobCharge and UpdateStockedItems. And in doing so this way you eliminate having to do the SetWarnings part. Anyway, that's what I use. Give it a whirl.

    have a nice one,
    BUD

Posting Permissions

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