By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

Updating query running from form

P: n/a
I have this update query

UPDATE [Storage Box Inventory] LEFT JOIN [Box Number/Contents Table] ON
[Storage Box Inventory].[Box Number]=[Box Number/Contents Table].[Box
Number] SET [Box Number/Contents Table].[Storage Date] = [Storage Box
Inventory].[storage date]
WHERE [Storage Box Inventory].[Box Number]=[Box Number/Contents
Table].[Box Number];

Which updated the storage date for all linked data with the similar box
number. Now I want to create a SQL that will run on a form command or
afterupdate.

The SQL above updates all data, I only want to update the date related
to the box number opened under the form. Ideally, access updates the
data (or something like that) after inputting the correct date under
the Storage Box Inventory form.

thanks,

danthrom

Jul 24 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

danthrom wrote:
I have this update query

UPDATE [Storage Box Inventory] LEFT JOIN [Box Number/Contents Table] ON
[Storage Box Inventory].[Box Number]=[Box Number/Contents Table].[Box
Number] SET [Box Number/Contents Table].[Storage Date] = [Storage Box
Inventory].[storage date]
WHERE [Storage Box Inventory].[Box Number]=[Box Number/Contents
Table].[Box Number];
AND [Storage Box Inventory].[Box Number] = me.cboboxnumber

you need to add a filter for the single record you're trying to update.
you need a [fieldname] = the open form's related field.

then assign that stuff to a button on your form.

docmd.openquery "qupd..."

If it's in a canned query, you can just point at the open form. (then
you need to use

=Forms![formname]![controlname]

Jul 25 '06 #2

P: n/a
Thanks,

you answered my question and it works well.

danthrom

pi********@hotmail.com wrote:
danthrom wrote:
I have this update query

UPDATE [Storage Box Inventory] LEFT JOIN [Box Number/Contents Table] ON
[Storage Box Inventory].[Box Number]=[Box Number/Contents Table].[Box
Number] SET [Box Number/Contents Table].[Storage Date] = [Storage Box
Inventory].[storage date]
WHERE [Storage Box Inventory].[Box Number]=[Box Number/Contents
Table].[Box Number];
AND [Storage Box Inventory].[Box Number] = me.cboboxnumber

you need to add a filter for the single record you're trying to update.
you need a [fieldname] = the open form's related field.

then assign that stuff to a button on your form.

docmd.openquery "qupd..."

If it's in a canned query, you can just point at the open form. (then
you need to use

=Forms![formname]![controlname]
Jul 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.