AboutScottgem Expertise I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.
Experience I've been designing databases for over 15 years working with dBase, FoxPro, Approach and Access.
Organizations Author of Microsoft Office Access 2007 VBA Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing
Question Hi Scott!! I'm sorry I keep coming back to you, I tried to find this answer, and couldn't. Could be there, but there's a LOT of answers on here.
My next thing I want to do is this...
I'd like to have a form that lists numerous records. And I guess I'd need to have a checkbox for each one too.
Basically I need to run an UPDATE query for each checkbox that has a tick in it. So anything that has a checkbox gets updated.
I also would need to run an APPEND query to add an entry in a different table for each checkbox ticked.
Can I send these checkboxes to more than one query? Very confused how I would do this!
Thanks so much, you rock!!
Answer No problem in coming back to me when you need help and can't find a similar question.
I need to clarify some things here. Is there no common criteria that can be used to select these records? Do you need the checkbox as the only way to select the record? If so, this is not difficult. You add a yes/no field to your table. Then check off the records you need act on. You then add a process selection command button with code like this:
Dim strSQL As String
strSQL = "UPDATE table SET field = value " & _
"WHERE [selectfield] = True;"
CurrentDB.Execute strSQL
strSQL = "INSERT INTO table (field list) " & _
"SELECT field list FROM table " & _
"WHERE [selectfield] = True;"
CurrentDB.Execute strSQL
The first SQL statement updates the table SETting the appropriate field to the appropriate value. The second statement appends the the field list from the table into your other table. The final statement resets the checkbox field.
Hope this helps,
Scott<>
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA