Thanks where would I start .....Thanks Bob
If you're going to provide this ability, I personally would make two
buttons, one a Select All, one a Clear All. Each would call the same
function that would mark them as true or false depending on the
argument. Since I don't know what fields in what table need to be
affected, I can only give a guideline, you'd need to work out the
syntax for the update query.
Add the following function to the forms module.
Sub SelAllNone(Optional SelectAll As Boolean = True)
On Error Goto stoprun
Dim sqlStr As String
Dim wrk As Workspace
Dim db As Database
Set wrk=DBEngine.Workspaces(0)
Set db=CurrentDb
'Insert real query string below
sqlStr = "UPDATE [tablename] SET [FieldName] = " & SelectAll & ";"
wrk.BeginTrans
db.Execute sqlStr, dbFailOnError
wrk.CommitTrans
Exit_Here:
Set wrk=Nothing
Set db=Nothing
Exit Sub
stoprun:
Msgbox Err.Number & " - " & Err.Description
wrk.RollBack
Resume Exit_Here
End Sub
Add a SelectAll button (and if desired a Select None) button to form
and add this line to the Click event of each.
'Select All
SelAllNone True
Me.Requery
'Select None
SelAllNone False
Me.Requery
Does that help?