Re: Updating query running from form



Thanks,

you answered my question and it works well.

danthrom

pietlinden@xxxxxxxxxxx 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]

.



Relevant Pages

  • Re: The Condition in a Macro
    ... > The DLookup is not going to filter anything... ... >> Now with your DLookup, for some reason, it has every single record, which ... >>> If you want to read the value from a control on an open form, ...
    (microsoft.public.access.macros)
  • Passing Query Parameters from form to another VBA subroutine
    ... You can refer to fields on any open form (whether the ... >I've got a form that lets the user filter a table full ... >selecting from values in six different fields - and am ... >parameters for the underlying query. ...
    (microsoft.public.access.queries)
  • Re: Form Opening
    ... I have another STRANGE issues. ... I added a button to the first form 'A' to filter on a specifc column: ... Private Sub AllProjects_Click ... filter button and then tries to open form C, ...
    (microsoft.public.access.forms)
  • Re: Drilling down
    ... can supply a "where condition" to filter the new open form to a limited ... MS Access MVP ... Van T. Dinh ...
    (microsoft.public.access.gettingstarted)
  • Re: Updating query running from form
    ... 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. ... If it's in a canned query, you can just point at the open form. ...
    (comp.databases.ms-access)