View Full Version : Command Buttons


geno
01-29-2002, 06:06 AM
Hi, I don't know if this is even possible or not but here goes. I have a form with 26 cmd buttons each caption is the letter of the alphabet. I would like to have one query look at this form and which ever button is clicked, it will sort the table by that letter. Thanks

mrabrams
01-29-2002, 07:16 AM
Check out the "Customer Phone List" form/query/macros in the Northwind Database.
It is exactly what you are asking for.

geno
01-29-2002, 10:13 AM
Thanks, this is exactly what I need.

geno
01-29-2002, 12:16 PM
I have another question for you. I got the macro to work Ok, but there is a message box that is suppose to come up when there are no records found ( [currentrecord]=0 )then a message box should come up. What happens is that when the filter is run, even if there are no records found, one record is shown in the form so no message box is displayed. Do you know how to get around this?
Thanks

geno
01-29-2002, 12:47 PM
Hi again, I was trying to get this to work and found out if I go into design view then back to form view, the message box will then display. Do you know how to get around this?
Thanks

David R
01-30-2002, 09:18 AM
When you go from Design View back to Form View, your form reruns its code, and thus prompts you again. Consider moving this code behind a command button if you do not want to see it every time, but keep in mind that you won't be editing it forever...(we hope).

HTH,
David R