A family of Microsoft relational database management systems designed for ease of use.
SG,
I think the problem is the space in the field name. Change the code to:
![On Scope]
Steve Schapel, Microsoft Access MVP
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a form that is based on a query. The form has checkboxes that are checked when the user wants to add the items from the underlying query to another table. Sometimes the user filters the form (which is displayed as a continuous form) to find several items that need to be added. Instead of them having to check every box that is listed with each record, I would like to have a way for them to select all of the checkboxes that are visible on the form. I just have no idea where to start with this even though I have been using Access for quite some time. Any ideas? Thanks in advance.
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
SG,
I think the problem is the space in the field name. Change the code to:
![On Scope]
Steve Schapel, Microsoft Access MVP
SG,
I haven't tested, but I think this would work, on the Click event of a Command Button in the form Header...
With Me.RecordsetClone
Do Until .EOF
.Edit
!YourYesNoField = True
.Update
.MoveNext
Loop
End With
Steve Schapel, Microsoft Access MVP
Sorry to not be more specific. Yes, I did replace the "YourYesNoField" with the actual name and left the ! in front of it.
Here is the code I have:
Private Sub Command36_Click()
With Me.RecordsetClone
Do Until .EOF
.Edit
!On Scope = Yes
.Update
.MoveNext
Loop
End With
End Sub
Thanks!
SG,
You mean you replaced the "YourYesNoField" with the actual name of the field in your table? And preceded it with a ! ?
Can you cut/paste your code to show us exactly what you put?
Steve Schapel, Microsoft Access MVP
That was a quick response! Thanks! I put the code in the click event of a command button in the form header as you said. However, when I click the button, I get a Compile Error: Syntax Error. The Line that references My YesNo Field is highlighted. I don't know VB well enough to know what this means...but I did double check to make sure I had the correct field name...