OpenForm

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JohnM

    #1

    OpenForm

    Excuse the tail of questions ... thanks for previous answers

    DoCmd.OpenForm "FormName", acNormal , , StLinkCriteria, acFormReadOnly

    works fine with StLinkCriteria as [NegBehave].[TutorGrp]= '" &
    Me![SelectGrp] & "'" (Select gop being from a combo box)

    I would have though if i had wanted to sort it I would just add (with a
    space) .....

    Order By [NegBehave].[" & SortField & "] DESC" (Where sort field is the
    field selected by the user.


  • Allen Browne

    #2
    Re: OpenForm

    You can set the sorting after you OpenForm:
    DoCmd.OpenForm ...
    With Forms("FormName ")
    .OrderBy = "[MyField] DESC"
    .OrderByOn = True
    End With

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "JohnM" <john@jmawer.de mon.co.ukwrote in message
    news:ejp88l$rae $1$8300dec7@new s.demon.co.uk.. .
    Excuse the tail of questions ... thanks for previous answers
    >
    DoCmd.OpenForm "FormName", acNormal , , StLinkCriteria, acFormReadOnly
    >
    works fine with StLinkCriteria as [NegBehave].[TutorGrp]= '" &
    Me![SelectGrp] & "'" (Select gop being from a combo box)
    >
    I would have though if i had wanted to sort it I would just add (with a
    space) .....
    >
    Order By [NegBehave].[" & SortField & "] DESC" (Where sort field is the
    field selected by the user.

    Comment

    Working...