command button to sort order

K

Kathy R.

Hi Folks!

I have a subform that's a continuous form that I use for attendance
taking. I would like to add a command button that, on click, sorts the
order of the attendees in a custom sort order. The user could then
continue adding more names, and sort occasionally as needed.

I have tried OrderBy and DoCmd RunSQL but am obviously missing
something. I, unfortunately, know enough about VBA to know that
something can be done, but struggle with how to get it to work. Could
someone help me out with the code that I need?

Thank you so much for your help!
Kathy R.

Main Form - frmAttendance
Sub Form - sfrAttendee
Custom Sort Order - ORDER BY tblFamily.FamLastName, tblFamily.FamID,
IIf([ContactStatus]="Primary Contact",1,IIf([ContactStatus]="Secondary
Contact",2,IIf([ContactStatus]="Other
Adult",3,IIf([ContactStatus]="Child",4,5)))), tblIndividual.FirstName;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top