Link to home
Start Free TrialLog in
Avatar of Jack Marley
Jack Marley

asked on

Open Form - Filter Field - Update Another Field in Table

Hi,

OnClick I'd like to open a form, filter by a field, and with ONLY the filtered records I'd like to update a Yes/No field in a table.

I've done the easiest bit, but also I'd like to update a field called 'SelectedPrint' in my 'Contacts' table with 'Yes' for every record filtered 'KI1100'

DoCmd.OpenForm "InvoiceEmail"
DoCmd.ApplyFilter , "Account = 'KI1100'"

Open in new window


Can anyone help?

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Jack Marley
Jack Marley

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PatHartman
Most times you don't want a hard-coded value so here is a better example:

SQLtext = "update Contracts set SelectedPrint= 'Yes' where Account= '" & Me.txtAccount & "'"

Or, if SelectedPrint is a Yes/No data type then:

SQLtext = "update Contracts set SelectedPrint= True where Account= '" & Me.txtAccount & "'"