Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select All Checkboxes

Status
Not open for further replies.

hunterlpr

Technical User
Nov 15, 2002
15
US
Hi, I'm looking for help on how to select all the checkboxes on a continuous form if the checkbox the user checks has a goal value of null. The problem is my form is set up dependent on grouping. It is grouped first by category, then by subcategory. So if the user selects say the record with Category "Basic"; Subcategory "Repair Wiring" and a blank goal then I want it to select all other records with the same Category and Subcategory. I hope this makes sense. I believe it may be a grouping or Select statement that's tripping me up. Any help would be greatly appreciated!!
 
are you trying to change the value in the Field, or just to filter the records? If you want to filter the records then you can do something like this, where you double-click on the field with the Category data and it filters based on that record, and then to turn the Filter off, you double-click on the RecordSelector or any visible part of the Detail section.

Function fFilter()
Me.Filter = "[Category] = '" & txtCategory & "' And [SubCategory] = '" & txtSubCategory & "'"
Me.FilterOn = True
Me.Requery
End Function

Private Sub Form_DblClick(Cancel As Integer)
Me.FilterOn = False
Me.Requery
End Sub

Private Sub Detail_DblClick(Cancel As Integer)
Me.FilterOn = False
Me.Requery
End Sub

Private Sub txtCategory_DblClick(Cancel As Integer)
Call fFilter
End Sub


If its updating then you need to create an update query or do it in code and reference the Category and SubCategory TextBoxes

PaulF
 
Thanks for your reply. I actually guess I want to update. What I have is a continuous form with many different categories and subcategories, such as:
Basic Skills
Repair Wiring
The student can....
Basic Skills
Repair Wiring
The student can
Basic Skills
Repair Wiring
The student can...
And if they've met all the Basic Skills under wiring I want them to be able to check the record labled Basic SKills, Repair Wiring, without a goal attached to it and that record will automatically update the other basic Skills, Repair to a true value...the code I have so far is something like this
Private Sub Obtained_AfterUpdate()
Dim rst As DAO.Recordset
Dim vartemp As String
Dim vartemp1 As String
Dim db As DAO.Database
Set db = CurrentDb


'Initializes variant
vartemp = DLookup("[category]", "abyocap", "[category] = Forms![abyocap]![category]")
vartemp1 = DLookup("[subcategory]", "abyocap", "[subcategory]=forms![abyocap]![subcategory]")

'Checks to see if this order number has been used before
If Me.Competency Is Null And Me.Obtained And Me.Category = vartemp Then


Me.Obtained = True
End If


End Sub

Keep in mind this is real rough and i'm not checking all yet, have to get my if statement right. Any ideas, would be great. By the way this form does not update a table it's for printing a report only. Many, many students and goals. Thanks
 
Okay I think I'm a lot closer ..the following code does what i want however i need to get it to loop until no match can anyone please help...thanks!

Dim rs As DAO.Recordset
Dim vartemp As Variant

vartemp = DLookup("[category]", "table1", "[category]=forms![form1]![category]")
If Me.Obtained = True Then
MsgBox ("made it past obtained is true")
vartemp = Forms!form1!category
DoCmd.GoToRecord , , acNext

If category = vartemp Then
MsgBox ("made it past vartemp")
Obtained = True
MsgBox ("made it past obtained=true")
End If

End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top