Make a little macro
GoToControl for the first action line and enter the field name at the bottom of the macro design screen. Don't enclose in brackets or commas
RunCommand for the second action line and from the bottom of the macro design screen select SortAscending
Place the macro on the Open event for the form. This does exactly the same as clicking in the field and then clicking A to Z on the toolbar.
I have not found code to be a good way to do this. It depends what else is involved with the form. I think it fouls up for me because I have code that scales the form for screen resolution.
DoCmd.GoToControl "FieldName"
DoCmd.RunCommand acCmdSortAscending