RE: Order By property
- From: "Sprinks" <Sprinks@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 13:43:05 -0700
Hi, Nikki.
In form design view, view properties with View, Properties and click the
square at the top left of the form to display the form's properties. Click
the Event tab, then click into the On Open field. Click the ellipsis to the
right of the field, and choose Code Builder if prompted.
Access will create the shell of a Visual Basic OnOpen event procedure.
Between the Sub and End Sub lines, enter the following code:
Me.OrderBy = "MyOrderByField"
Me.OrderByOn = True
Replace MyOrderByField with the name of the field (or fields, separated by
commas) you wish to order by, and include the quotes to make it a string
value. Save the code and the form and you're in business.
Hope that helps.
Sprinks
"NikkiB" wrote:
> Hi,
>
> I have an inquiry Form linked to a query which prompts for Criteria. I have
> set the Order By Property to FieldABC but once the report opens in continuous
> form view I allow the users to "re-sort" the data. I provide them with a
> custom toolbar containing the Sort Ascending and Sort Descending menu items.
> This all works great except...
>
> Once the user "re-sorts" the data it overwrites my original OrderBy Property
> setting. Is there a way in VB that I can reset the sort order using the
> OnOpen Event? I tried to use the acCmdSortAscending but do not know how to
> write VB.
>
> Any input would be greatly appreciated.
>
> Thanks so much for your help.
>
> Nicole
.
- Follow-Ups:
- RE: Order By property
- From: NikkiB
- RE: Order By property
- References:
- Order By property
- From: NikkiB
- Order By property
- Prev by Date: Re: Warning Message
- Next by Date: Re: Order By property
- Previous by thread: Order By property
- Next by thread: RE: Order By property
- Index(es):
Relevant Pages
|
|