Update Query

G

Greg

I am working on an auction database where each buyer has a buyer number. I
have a buyer receipt that prints. When I click on the Buyer Receipt button a
select query parameter requests the buyer number. A criteria is than set for
that buyer number and the receipt prints. While the criteria is set I would
like to update the database on two fields - one called "Receipt" which is a
Yes/No and the other called "Printed" which I update to "Receipt printed:
"&Date()" to get a time stamp on the receipt time. Later in the reports I
will print out that a receipt was printed and when.

How can I update the database while it is open with the criteria set to the
correct buyer number? I can do another parameter call in an update query and
enter the buyer number again. Is there a way to pass the buyer number to the
update query so I don't have to put in the buyer number twice? Or is there
another way just to update those two fields while the database is open?

Thanks for any help.
 
P

pietlinden

I am working on an auction database where each buyer has a buyer number.  I
have a buyer receipt that prints.  When I click on the Buyer Receipt button a
select query parameter requests the buyer number.  A criteria is than set for
that buyer number and the receipt prints.  While the criteria is set I would
like to update the database on two fields - one called "Receipt" which isa
Yes/No and the other called "Printed" which I update to "Receipt printed: 
"&Date()" to get a time stamp on the receipt time.  Later in the reports I
will print out that a receipt was printed and when.  

How can I update the database while it is open with the criteria set to the
correct buyer number?  I can do another parameter call in an update query and
enter the buyer number again.  Is there a way to pass the buyer number to the
update query so I don't have to put in the buyer number twice?  Or is there
another way just to update those two fields while the database is open?

Thanks for any help.

Easiest way is to put the buyer number on a form. Doesn't have to be
bound to a table (you could use a combobox). then you can reference
the control on your update query.

UPDATE MyTable
SET MyField = Forms![MyOpenFormName]![cboBuyerNumber]
WHERE MyTable.UniqueID = Forms![MyOpenFormName]![txtUniqueID]
 
M

miss031

am working on something similar. My system works so that, the cashier opens a
form to first view the purchases for that bidder, so the form nad subform are
filtered by that bidder's number, and then I run the receipt report from that
form, passing the bidder number to the report's query through OpenArgs. You
could also run your update query at the same time, using the field in your
form that contains the bidder number as the criteria in your sql.

I am working on an auction database where each buyer has a buyer number. I
have a buyer receipt that prints. When I click on the Buyer Receipt button a
select query parameter requests the buyer number. A criteria is than set for
that buyer number and the receipt prints. While the criteria is set I would
like to update the database on two fields - one called "Receipt" which is a
Yes/No and the other called "Printed" which I update to "Receipt printed:
"&Date()" to get a time stamp on the receipt time. Later in the reports I
will print out that a receipt was printed and when.

How can I update the database while it is open with the criteria set to the
correct buyer number? I can do another parameter call in an update query and
enter the buyer number again. Is there a way to pass the buyer number to the
update query so I don't have to put in the buyer number twice? Or is there
another way just to update those two fields while the database is open?

Thanks for any help.

Easiest way is to put the buyer number on a form. Doesn't have to be
bound to a table (you could use a combobox). then you can reference
the control on your update query.

UPDATE MyTable
SET MyField = Forms![MyOpenFormName]![cboBuyerNumber]
WHERE MyTable.UniqueID = Forms![MyOpenFormName]![txtUniqueID]
 

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