RUN QUERY BUT DON'T SHOW RESULT

W

Wayne Veale

Been a long day.. I have a select query that sorts a fld dec and the Top
Values is 1 getting me to the last rec I'm looking for. This works fine but
when I execute the macro (this qry) it shows the query result. I don't want
to see the query, I just want it to execute it. How do I stop the query from
"showing"?
Thanks WWV
 
J

John Vinson

Been a long day.. I have a select query that sorts a fld dec and the Top
Values is 1 getting me to the last rec I'm looking for. This works fine but
when I execute the macro (this qry) it shows the query result. I don't want
to see the query, I just want it to execute it. How do I stop the query from
"showing"?
Thanks WWV

A Select query exists ONLY to return data. You don't "execute" it; it
doesn't *do* anything other than return a recordset. You can execute
an Action query (such as an Update query or a MakeTable query), but
typically a select query would just be used as the recordsource for a
Form or Report, or as the RowSource for a combo or listbox, or
possibly as the source of a Recordset in code.

What DO you want to happen when you "execute" this query? What's the
context?

John W. Vinson[MVP]
 
W

Wayne Veale

I use this query to go to the last record in a table.

Top Values is = to 1
Fld gc sales recupdat
Table SLS DATA TBL SLS DATA TBL
Sort Descending
Show X X
criteria -1

I use this to goto the last rec (recupdat = -1)
 
J

John Vinson

I use this to goto the last rec (recupdat = -1)

I'm still confused. A Query doesn't "go to" anywhere.

What's the CONTEXT? Are you using a Form, a Report, opening the query
datasheet to view the last record, or what?

John W. Vinson[MVP]
 
W

Wayne Veale

I think what I have done is created a monster. All I really want to do is
....
I have a form that a sales amount is entered in field SLSAMT in a tbl SALES
TBL. (CUST TBL one to many to SALES TBL) I also want the same amount put
into a another field (same SALES TBL) called SLSAMT FOR COUPON. Heres my
requirements and why I took the approach I did. SLSAMT will give me totals
of sales for all sales. This works fine. I also need these amounts to
total for printing a 5.00 off next purchase coupon if the total of SLSAMT is
50.00 or over, and the store wants to print the coupon. I use SLSAMT FOR
COUPON for this because, When the store does print the coupon (can happen
ANY time SLSAMT FOR COUPON is 50.00 or over) , I need to add a new record to
to the tbl with SLSAMT zero and SLSAMT FOR COUPON -50.00 to show a current
amount for coupon reduced by 50.00. SLSAMT will show me total amount of
sales, and SLSAMT FOR COUPON will show me a current total for coupon and
how many coupons we have printed (the -50.00 records). I have tried
different ways to duplicate SLSAMT into SLSAMT FOR COUPON on the form
without keying it twice without success. I'm currently trying to find the
best approach to learn VB so that I can solve many problems I run into and
any suggestion to the best way to learn this would be helpful.
Thanks for any help
wwv
 
W

Wayne Veale

Wayne Veale said:
I think what I have done is created a monster. All I really want to do is
...
I have a form that a sales amount is entered in field SLSAMT in a tbl
SALES TBL. (CUST TBL one to many to SALES TBL) I also want the same
amount put into a another field (same SALES TBL) called SLSAMT FOR COUPON.
Heres my requirements and why I took the approach I did. SLSAMT will give
me totals of sales for all sales. This works fine. I also need these
amounts to total for printing a 5.00 off next purchase coupon if the total
of SLSAMT is 50.00 or over, and the store wants to print the coupon. I use
SLSAMT FOR COUPON for this because, When the store does print the coupon
(can happen ANY time SLSAMT FOR COUPON is 50.00 or over) , I need to add a
new record to to the tbl with SLSAMT zero and SLSAMT FOR COUPON -50.00 to
show a current amount for coupon reduced by 50.00. SLSAMT will show me
total amount of sales, and SLSAMT FOR COUPON will show me a current total
for coupon and how many coupons we have printed (the -50.00 records). I
have tried different ways to duplicate SLSAMT into SLSAMT FOR COUPON on
the form without keying it twice without success. I'm currently trying to
find the best approach to learn VB so that I can solve many problems I run
into and any suggestion to the best way to learn this would be helpful.
Thanks for any help
wwv
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top