Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 17th, 2004, 10:21 AM
Ben Ben is offline
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default Continuous Forms

I have a form with the default view set to Continuous forms, the form diplays a dynamic amount of records returned from a query.
The last field in the query is a check box, I want to create a button in the form footer that will check all the check boxes displayed on the form.
[Stupidly] I tried chkbox.value = true, but this only applies to the first record (form) displayed.
I guess I'm going to have to do a for each, next loop but I'm unsure what to apply this to. Can anyone help!

Thanks in advance
Ben
 
Old February 17th, 2004, 10:31 AM
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ben,
  You can use the recordsetclone object if there aren't a ton of records to perform this update.

  In the click event of the button put this code

  Do while not me.recordsetclone.eof
     me.recordSetclone.Edit
     me.chkbox.value = True
     me.recordsetclone.update
     me.recordsetclone.movenext
  loop
  me.refresh

  Another alternative, faster alternative, would be to create an update SQL statement that would update all the records in a single pass. Ensure that it contains the same where clause as the recordsource for the form.

HTH,
Mike
 
Old February 17th, 2004, 10:34 AM
Ben Ben is offline
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Mike that helps a lot :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating Continuous Forms Bobbyworld Access VBA 8 May 13th, 2007 03:28 AM
continuous forms question hamffjs Access 3 January 29th, 2007 01:33 PM
Checkboxes and continuous forms mdProgrammer Access VBA 4 August 3rd, 2006 09:47 AM
Continuous Forms Issues strikeuk Access 1 January 2nd, 2006 11:59 AM
2 synchronous combos in continuous forms Cr0vaX Access VBA 3 May 22nd, 2004 11:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.