Results 1 to 3 of 3

Thread: Plz Help!

  1. #1
    Join Date
    Apr 2008
    Posts
    2

    Unanswered: Plz Help!

    Hello guys and gals!
    I am having this kind of a problem: Access 2007
    I have a form which asks to enter a zipcode.
    When user types a zipcode he hits the button "ok"
    "ok" processes a such macro

    Macro condition Action Arguments
    opendialog Open Form testform,form,,,edit,normal
    Notisloaded("test2") Cancel Event
    CloseDialog Close Form,testform,Prompt

    ok setvalue [visible],no
    Beep
    OpenQuery relationdb Query, ds,reado
    Requery
    OpenReport TestReport,Report,,,Norm
    RunCommand Refresh

    So the problem i meet when Access opens report, report has an old data in it that why i tried to apply command "Refresh" but that command doesn't work either. Even manually u hit button "refresh" on menu it doesnt refresh data with new query results. It does work though when u hot button "Refresh All". It gives me a report with current query results. But how can I have "Refresh All" command done automatically, so people wouldn't need to hit "refresh all" every time they type in a new zipcode and get a report with results of previous query. Because in argument's list of "RunCommand" action i have just "Refresh" and "RefreshPage" commands. If someone knows how to fix it i would really appreciate it.

    Thank you very much

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Go to your macro, right click it and chose "Save As..."
    Select to save as a module and then post the code generated back here.
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2008
    Posts
    2

    Fix

    Thank you George for your reply. I fixed the problem.
    I just needed to add "requery" action with blank arguments after action "OpenReport" and that did the job. Now ir refreshes all the report records.
    But thank you anyway.
    Cheers!!!

Posting Permissions

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