Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-04-2017, 06:53 AM   #1
MattCass87
Newly Registered User
 
Join Date: Sep 2017
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
MattCass87 is on a distinguished road
Button update check box to true for all records in subform query

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
Attached Files
File Type: zip Archive.zip (97.6 KB, 26 views)

MattCass87 is offline   Reply With Quote
Old 10-04-2017, 06:57 AM   #2
Ranman256
Newly Registered User
 
Join Date: Apr 2015
Location: KY,USA
Posts: 3,319
Thanks: 0
Thanked 728 Times in 713 Posts
Ranman256 will become famous soon enough Ranman256 will become famous soon enough
Re: Button update check box to true for all records in subform query

the query that shows the items in the form,
Make an update query that uses THAT query to modify the checkboxes.
Ranman256 is offline   Reply With Quote
Old 10-04-2017, 06:59 AM   #3
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,275
Thanks: 105
Thanked 2,491 Times in 2,287 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Button update check box to true for all records in subform query

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

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 10-04-2017, 07:18 AM   #4
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,002
Thanks: 460
Thanked 887 Times in 842 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Button update check box to true for all records in subform query

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"
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)

Last edited by Uncle Gizmo; 10-04-2017 at 07:25 AM.
Uncle Gizmo is offline   Reply With Quote
Old 10-04-2017, 07:47 AM   #5
MattCass87
Newly Registered User
 
Join Date: Sep 2017
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
MattCass87 is on a distinguished road
Re: Button update check box to true for all records in subform query

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.
MattCass87 is offline   Reply With Quote
Old 10-04-2017, 04:00 PM   #6
Mark_
Longboard on the internet
 
Join Date: Sep 2017
Location: Not the middle of no where, but I can see the road to it from my house.
Posts: 1,827
Thanks: 17
Thanked 345 Times in 342 Posts
Mark_ will become famous soon enough Mark_ will become famous soon enough
Re: Button update check box to true for all records in subform query

Quote:
Originally Posted by MattCass87 View Post
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.

Mark_ is offline   Reply With Quote
Reply

Tags
access , query , update , vba

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Rows Where Checkbox = True in Subform Adam McReynolds Modules & VBA 3 07-02-2015 09:14 PM
How to have query display in one cell the true values of many check boxes hockey8837 Queries 5 01-18-2010 07:22 AM
Update query-If criteria true,value true else false in same query merc_slk Queries 3 01-11-2010 02:27 PM
Check each row if 2 checkboxes are true, and update another field BartB Forms 7 02-04-2009 05:17 AM




All times are GMT -8. The time now is 02:05 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World