Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Query results in messagebox

Discussion in 'Information Technology' started by Wendy, Jul 28, 2006.

  1. Wendy

    Wendy
    Expand Collapse
    Guest

    Hi

    Is is possible to display the results of a query in a messagebox. I wanted
    to do this to give the users the chance to abort the rest of the macro if
    the results were not correct.

    Thanks

    Wendy
     
  2. Loading...

    Similar Threads Forum Date
    Query about Jhatka Meat by Shooting in Head Sikh Sikhi Sikhism Aug 26, 2011
    Who is a sikh? A non sikh friend's query!! Sikh Sikhi Sikhism Apr 30, 2010
    General Query Hard Talk Sep 4, 2008
    Power of pauri's in Japji Sahib query Sikh Sikhi Sikhism Aug 17, 2006
    Sikhism a query Book Reviews & Editorials Aug 2, 2005

  3. Mastercafe - Juan

    Mastercafe - Juan
    Expand Collapse
    Guest

    Using VBa sure.. direct from Query no..

    --
    Saludos desde Oviedo (Asturias)

    Juan Menéndez
    Mastercafe S.L.
    www.mastercafe.com
    juan@mastercafe.com

    Si la información recibido te ha servido indicalo con otro post.
    En caso de resolverlo por otros medios, indica la solución usada
    ayudaras a otros y aprenderemos todos.

    "Wendy" <Wendy @sunnygirl.com> escribió en el mensaje
    news:g-ydnSmFjomdsRDZRVnyhw@bt.com...
    > Hi
    >
    > Is is possible to display the results of a query in a messagebox. I
    > wanted
    > to do this to give the users the chance to abort the rest of the macro if
    > the results were not correct.
    >
    > Thanks
    >
    > Wendy
    >
    >
     
  4. Wendy

    Wendy
    Expand Collapse
    Guest

    I'm a novice at vb can you give some help please?

    Thanks

    Wendy
    "Mastercafe - Juan" <vbnet@mastercafe.com> wrote in message
    news:ekxFm5fjGHA.836@TK2MSFTNGP02.phx.gbl...
    > Using VBa sure.. direct from Query no..
    >
    > --
    > Saludos desde Oviedo (Asturias)
    >
    > Juan Menéndez
    > Mastercafe S.L.
    > www.mastercafe.com
    > juan@mastercafe.com
    >
    > Si la información recibido te ha servido indicalo con otro post.
    > En caso de resolverlo por otros medios, indica la solución usada
    > ayudaras a otros y aprenderemos todos.
    >
    > "Wendy" <Wendy @sunnygirl.com> escribió en el mensaje
    > news:g-ydnSmFjomdsRDZRVnyhw@bt.com...
    > > Hi
    > >
    > > Is is possible to display the results of a query in a messagebox. I
    > > wanted
    > > to do this to give the users the chance to abort the rest of the macro

    if
    > > the results were not correct.
    > >
    > > Thanks
    > >
    > > Wendy
    > >
    > >

    >
    >
     
  5. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Wendy,

    Well, yes possibly - it depends what you mean, really. I've just been
    working tonight with a query that returns 150,000 rows, about 30 fields,
    and I wouldn't like to try and put that into a message box! Can you
    please give some more details, with examples, of what you want to do?

    --
    Steve Schapel, Microsoft Access MVP

    Wendy wrote:
    > Hi
    >
    > Is is possible to display the results of a query in a messagebox. I wanted
    > to do this to give the users the chance to abort the rest of the macro if
    > the results were not correct.
    >
    > Thanks
    >
    > Wendy
    >
    >
     
  6. Wendy

    Wendy
    Expand Collapse
    Guest

    Yes its a bank statement, that we download daily direct from the bank,
    sometimes we don't end up with the correct days transactions and want to see
    the date and values before allowing the macro to continue. The macro add
    our id codes to the data, exports it to the mainframe as fixed text file and
    the mainframe attaches the transactions to the database.
    I only need to display the first line from each file, unfortunately we don't
    know how many files the bank is going to send each day, so we have to do
    each one individually. I can do it in a query but I wanted to do it in a
    messagebox displayed whilst the macro was running giving the option to kill
    the macro if the data was incorrect.
    This is the code from the query.
    SELECT TOP 1 NLMBANK1.TRANSDATE, NLMBANK1.AMOUNT, NLMBANK1.DETAILS,
    NLMBANK1.TRANSCODE, NLMBANK1.CHEQUENO
    FROM NLMBANK1
    WHERE (((NLMBANK1.TRANSCODE) Not Like "CC" And (NLMBANK1.TRANSCODE) Not Like
    "MSC" And (NLMBANK1.TRANSCODE) Not Like "CHG"));

    Wendy





    "Steve Schapel" <schapel@mvps.org.ns> wrote in message
    news:OvaTcdgjGHA.1324@TK2MSFTNGP04.phx.gbl...
    > Wendy,
    >
    > Well, yes possibly - it depends what you mean, really. I've just been
    > working tonight with a query that returns 150,000 rows, about 30 fields,
    > and I wouldn't like to try and put that into a message box! Can you
    > please give some more details, with examples, of what you want to do?
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    > Wendy wrote:
    > > Hi
    > >
    > > Is is possible to display the results of a query in a messagebox. I

    wanted
    > > to do this to give the users the chance to abort the rest of the macro

    if
    > > the results were not correct.
    > >
    > > Thanks
    > >
    > > Wendy
    > >
    > >
     
  7. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Wendy,

    You can do this in a Condition in your macro.

    Your query at the moment has an unusual use of the Like operator, which
    is normally used in the case of where a wildcard in involved in your
    criteria. From your explanation, I gather you would really only need to
    see the date. So, the Condition like this...

    MsgBox("Process transactions for " &
    DLookup("[TRANSDATE]","NLMBANK1","[TRANSCODE] Not In('CC','MSC','CHG')")
    & "?",36)=6

    --
    Steve Schapel, Microsoft Access MVP

    Wendy wrote:
    > Yes its a bank statement, that we download daily direct from the bank,
    > sometimes we don't end up with the correct days transactions and want to see
    > the date and values before allowing the macro to continue. The macro add
    > our id codes to the data, exports it to the mainframe as fixed text file and
    > the mainframe attaches the transactions to the database.
    > I only need to display the first line from each file, unfortunately we don't
    > know how many files the bank is going to send each day, so we have to do
    > each one individually. I can do it in a query but I wanted to do it in a
    > messagebox displayed whilst the macro was running giving the option to kill
    > the macro if the data was incorrect.
    > This is the code from the query.
    > SELECT TOP 1 NLMBANK1.TRANSDATE, NLMBANK1.AMOUNT, NLMBANK1.DETAILS,
    > NLMBANK1.TRANSCODE, NLMBANK1.CHEQUENO
    > FROM NLMBANK1
    > WHERE (((NLMBANK1.TRANSCODE) Not Like "CC" And (NLMBANK1.TRANSCODE) Not Like
    > "MSC" And (NLMBANK1.TRANSCODE) Not Like "CHG"));
    >
    > Wendy
    >
     

Share This Page