views:

85

answers:

2

Hi, sorry my english. I don´t speak it very well.

Well, I'm developing an Access DB and I'd like do implement 2 buttons that, when clicked down, sort my subform "SUBForm1" according to parameters: asceding alphabetic order by NAME and one another ascending by Month.

Is that possible?

I´d be glad for every answer.

Thank's

A: 

You can use the "acCmdSortAscending" method.

For example;

Private Sub btnSortByName_Click()

Forms!frmYourForm![SUBForm1].SetFocus
[fldName].Form![fldName].SetFocus
DoCmd.RunCommand acCmdSortAscending
Pace
Hi, Thank´s for the help. Well, it had worked fine on the first situatin. Sortting by name, but, trying to do the same thing on the filed MONTH, i´v got the following error: Error 438"Object Doesn't Support This Property or Method"I believe tha´s because the field Month is provenient from a query - month:format([date_contact];"mm") and maybe it has the data type definided as Date. What do you think?Thank´s a lot!
Gil Kléber
A: 

Hi,

Thank´s for the help. Well, it had worked fine on the first situatin. Sortting by name, but, trying to do the same thing on the filed MONTH, i´v got the following error:

Error 438"Object Doesn't Support This Property or Method" I believe tha´s because the field Month is provenient from a query - month:format([date_contact];"mm") and maybe it has the data type definided as Date. What do you think?

Thank´s a lot!

Gil Kléber