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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a form with some checkboxes 3

Status
Not open for further replies.

sanders720

Programmer
Aug 2, 2001
421
0
0
US
I have a form with some checkboxes on it. I would like to sort my data based on the checkbox. Below is an example. Order is a public variable that is set to ASC or DESC depending on another checkbox.

I believe Me.Requery may not be correct. There are no errors with this, except that nothing happens. What should I do?

Thanks for the help!


Private Sub chkSortbyPartDesc_Click()
chkSortbyItem = False
chkSortbyPartNo = False
chkSortbyRelBy = False
chkSortbyRelDate = False
Me.OrderBy = "qryBOM.PartDescription " & ORDER
Me.Requery

End Sub
 
Sanders720

I haven't played with the orderbyon property much, but that might be what you need to check. I made a simple form with two checkboxes custno & Prevno. Viewed in datasheet mode the form will change the sort and apply the sort based on the checkbox that was selected.

Private Sub Custno_Click()
If Me.Custno = -1 Then
Me.OrderBy = "custno"
Me.OrderByOn = True
Me.Requery
End If
End Sub
Private Sub PrevNo_Click()
If Me.PrevNo = -1 Then
Me.OrderBy = "PrevNo"
Me.OrderByOn = True
Me.Requery
End If

End Sub
 
That was it... The Me.OrderByOn took care of it.

Thanks a lot!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top