update query

dott

Registered User.
Local time
Today, 17:41
Joined
Jun 24, 2003
Messages
56
is it possible to make an update query where the "update to" parameter could be specified by the user?

that is, i want to update the field to a non-static string
 
Yes but it will set the same data for every record!
in the update to box, add [Enter Value to be Used] or whatever you want in [square brackets] and the query will prompt for a new value. This new value will be plugged into every record mind you!

If you want a different value for each/grop of records, you will need to use a series of queries or VB.
 
You could of course also add criteria to some other field to restrict and allow users to specify the records they want updated
 
sounds good. i want it to update all the values to the same one...

anyway to do this using a form instead of those ugly prompt boxes?
 
Yep, just set up a form with an unbound textbox and a command button. On the on_Click event of the command button, in the VB window, use

docmd.openquery "NameOfQuery"

If you want to supress the confirmation messages, use this instead

docmd.setwarnings false
docmd.openquery "NameOfQuery"
docmd.setwarnings true

In the update To box, set this to

=Forms!NameOfForm"NameofUnboundTextbox

and it will plug in the value from the form.
 

Users who are viewing this thread

Back
Top Bottom