A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update Query



 
 
Thread Tools Display Modes
  #1  
Old July 17th, 2008, 05:22 PM posted to microsoft.public.access.queries
Greg
external usenet poster
 
Posts: 748
Default Update Query

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.


  #2  
Old July 18th, 2008, 07:13 AM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 744
Default Update Query

On Jul 17, 11:22*am, Greg wrote:
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]
  #3  
Old July 19th, 2008, 08:14 AM posted to microsoft.public.access.queries
miss031
external usenet poster
 
Posts: 60
Default Update Query

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.

" wrote:

On Jul 17, 11:22 am, Greg wrote:
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]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.