Results 1 to 6 of 6

Thread: Macro problem

  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro problem

    I'd appreciate some advise please on this "problem":
    Background - database written in A97 and recently converted to A2000.
    We have a report that requires 3 parameters, 1 is [style], 2 is client's [code] and 3 is [year].

    The report is called by a macro (which used to work perfectly) and this is what shows on screen

    Enter Parameter Value Style of Accounts (I would enter draft, then press OK)

    Enter Parameter Value Please enter Clients Code], 2 [Unknown]= (so I enter a clients code, press OK)

    Enter Parameter Value Style of Accounts (now here I enter a year say 2001, press OK)

    Enter Parameter Value Please enter Clients Code], 5 [Unknown]= (just press enter)

    Report opens as it should at the correct record and with correct data! The macro uses a where condition in the open report which is [secode]=[Enter Client's Code] And [TrYear]={Enter Year ending]. So why do I get the screwed up messages in the Enter Parameter boxes?
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macro problem

    First off, can we clarify terminology? You can call a report from a macro or from code, which isn't the same thing in Access, so which one are you talking about? Are the parameters in the underlying query or are you capturing in put in code? Why don't you post the relevant code (if that's what we're talking about) and maybe someone can spot the problem. If the parameters are in a query, post the SQL for the query.
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro problem

    Ooops, sorry Charlotte, I will clarify:
    The report is based on a query, the query has no filters whatsoever. The macro calls the report and in the macro where condition is [Code]=[Please enter client's code]and [Year]=Please enter Year ending].

    After reading your reply, I tried to enter these two criteria into the query and got the same result as from the macros. Incidentally, the field {code] is alphabetic and [Year] numeric.
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macro problem

    Wait, are these in the macro condition column or in the where condition for the OpenReport action? And what do you mean by this
    <hr>So why do I get the screwed up messages in the Enter Parameter boxes?<hr>
    You told us what the screen displayed, so what message is wrong and what's wrong with it?
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro problem

    The where condition is in the macro action column of the OpenReport Action.

    The Where condition reads: [code]=[please enter clients code] and [Year]=[Please enter Year ending]

    When this macro is run the Enter Parameter Value box pops up and requests client's code then another EPV box requests for a style, lastly the 3rd EPV box states (where it should request a Year & here's the error message) Please enter clients code], 3 unknown=
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macro problem

    Macros are VERY bad at handling parameters, so you've been lucky to make it work in the past. The condition is intended to control execution of the macro, not to pass arguments to anything else. How are you passing the condition to the report?

    All three of the parameters are in the same condition espression, right? So where is the [style] parameter? I don't see it in what you posted. Just copy the whole condition expression from your macro and paste it into your post, then we can start from the same point.
    Charlotte

Posting Permissions

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