Sorting Columns In Forms

G

Guest

What command would I use assign to a button on a form that would sort data on
the form. I have several columns and would like to have several buttons (one
for each column) that a user can click to sort the respective columns.

Thanks in advance!

Aaron G
Philadelphia, PA
 
M

M.L. Sco Scofield

In the click event of each button, put:

txtYourName.SetFocus
DoCmd.RunCommand acCmdSortAscending

Replace txtYourName with the name of the text box for each field.

Good luck.

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Denver Area Access Users Group Vice President www.DAAUG.org
MS Colorado Events Administrator www.MSColoradoEvents.com
Useful Metric Conversion #18 of 19: 8 nickels = 2 paradigms (My personal
favorite)
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
M

M.L. Sco Scofield

You're welcome.

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Denver Area Access Users Group Vice President www.DAAUG.org
MS Colorado Events Administrator www.MSColoradoEvents.com
Useful Metric Conversion #18 of 19: 8 nickels = 2 paradigms (My personal
favorite)
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
G

Guest

This process works with forms that pull from queries that are based on
criteria boxes. Other solutions to this issue don't work with form-based
queries.

Thank you for this info, works great.
 

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