Results 1 to 6 of 6

Thread: macros (2000)

  1. #1
    2 Star Lounger
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    macros (2000)

    I'm trying to create a macro that will display a message box when a field on a form looses focus if the results of a query is not null. I'm not having much success. I've tried to set the macro condition of the message box to show only if the query is null, but it keeps telling me it can't find the query. I've tried to have the macro open the query before it shows the message and I get the same thing.

    Any suggestions?

    Eric

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

    Re: macros (2000)

    What query are you talking about? Are you running a query in the macro as well? If so, do you have the name of the query spelled correctly?
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Nov 2001
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macros (2000)

    Will this work for you?

    If DCount("*", "QueryName") >= 1 then
    Msgbox = "There is Data in your query"
    End if

    Jack

  4. #4
    2 Star Lounger
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macros (2000)

    Thanks. I've tried it and get the message, "Compile Error: Function call on left side of assignment must return Variant or Object"

  5. #5
    2 Star Lounger
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macros (2000)

    I've got it working now. I did a macro to run a message box with the condition

    DCount("*","qryPending")>=1

    Thanks alot.

    Eric

  6. #6
    Star Lounger
    Join Date
    Nov 2001
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macros (2000)

    Glad you got it working!

    Jack

Posting Permissions

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