Button update check box to true for all records in subform query (1 Viewer)

MattCass87

New member
Local time
Today, 21:00
Joined
Sep 4, 2017
Messages
8
Hi

Please see attached table layout and form.

Not sure if I need VBA or can complete this via an update query, i've seen conflicting options on the web.

I want that command46 button when clicked to change the status field checkbox of each ElementID in ItemDetails table to true

but, only to the ElementID associated to the ItemID's and PartID displayed in the form

Thanks in advance.

Thanks

Matt
 

Attachments

  • Archive.zip
    97.6 KB · Views: 80

Ranman256

Well-known member
Local time
Today, 17:00
Joined
Apr 9, 2015
Messages
4,339
the query that shows the items in the form,
Make an update query that uses THAT query to modify the checkboxes.
 

isladogs

MVP / VIP
Local time
Today, 21:00
Joined
Jan 14, 2017
Messages
18,186
I would use an update query unless you find that its read only.
Create a select query filtered to one item as a test.
Check whether you can edit the status manually.
If you can, change it to an update query
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:00
Joined
Jul 9, 2003
Messages
16,245
I answered a similar question recently and produced a video by way of explanation. The video is this one "Checklist - How to Check ALL" on this page:- Check List Extras

The video demonstrates two buttons, one to check, and one to uncheck.

If you want a single button, then there's a link to another video which shows how to use a single button.

Click on the link called:- "Convert the Two Buttons to One - HERE"
 
Last edited:

MattCass87

New member
Local time
Today, 21:00
Joined
Sep 4, 2017
Messages
8
Thanks all for the pointers, it really helped and I've cracked it! :)

I created a SELECT query to gather all elementID, itemID, PartID and status of each element.

I then added in the criteria for PartID to look at the PartID of the form previously attached. [Forms]![Formspecified]![PartID]

this then pulled the correct elements from that partID.

I then turned this into a UPDATE query.
 

Mark_

Longboard on the internet
Local time
Today, 14:00
Joined
Sep 12, 2017
Messages
2,111
I want that command46 button when clicked

As you get into using VBA with access, you'll find that leaving default names like this will become terribly un-useful. I'd suggest getting in the habit of using a naming convention for these kinds of controls now rather than later.

Btn_CheckAll will make far more sense to you a month from now than command46.

A good naming convention often consists of identifying what type of item you are referencing followed by a descriptive name. I generally use three letters for controls and one or two to identify queries, reports, forms, or tables.
 

Users who are viewing this thread

Top Bottom