Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Select All CheckBox

Posted on 2003-11-24
2
Medium Priority
?
1,743 Views
Last Modified: 2008-03-15
Access 97 ..

I have a continuous form containing a number of records, each of which has a CheckBox linked to a field [fldUpdate].

I also have an update query that updates the records where the above checkbox = True.

How can I add a further checkbox to the form that will act as a 'Select All' box, i.e. when the Select All checkbox is set to True, the checkbox on each record is also set to True - when the Select All checkbox is set to False the checkbox on each record is also set to False.

I have little knowledge of VB, so please comment any code provided.
0
Comment
Question by:WebMaker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Expert Comment

by:udir
ID: 9809257
Hi WebMaker
You can do it in 2 ways:
1) If checkboxMain.Value = -1 then
     DoCmd.runsql "Update Tbla1.checkbox
      SetTbl1.[checkbox] = -1
   end if
   me.requery
2)   (First open a recordset)
    rcrdCount = rst.RecordCount
     rst.movefirst  
         for x = 1 to rcrdCount
           rst.edit
            rst![checkbox] = -1
           rst.move next
         next x
       rst.edit    
    rst.refresh
  me.refresh

Hope it helps
Udir

0
 
LVL 1

Accepted Solution

by:
udir earned 500 total points
ID: 9809296
Hi WebMaker
OOOPS
Try this, it works...
Private Sub ww_Click()
  If checkboxMain.Value = -1 Then
    DoCmd.RunSQL "Update tbl1 SET tbl1.checkbox= -1"
   Else
    DoCmd.RunSQL "Update tbl1 SET tbl1.checkbox= 0"
  End If
 Me.Refresh
 End Sub
Udir
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question