Professional Web Applications Themes

sorting/clearing - Microsoft Access

i have a switchboard that i can open several different forms. one form allows me to select records to be displayed on a report through the use of check boxes. I.E. i open the form, check the box of the records that i want to compare, then close the form. I would like to add two features to this form, but i cant figure out how. First and foremost...i would like to be able to reorder each field through the use of a control button. This is similar to what eBay and others use to sort their auctions in ascending/descending ...

  1. #1

    Default sorting/clearing

    i have a switchboard that i can open several different
    forms. one form allows me to select records to be
    displayed on a report through the use of check boxes.
    I.E. i open the form, check the box of the records that i
    want to compare, then close the form.

    I would like to add two features to this form, but i cant
    figure out how.

    First and foremost...i would like to be able to reorder
    each field through the use of a control button. This is
    similar to what eBay and others use to sort their
    auctions in ascending/descending order using price, year,
    etc.......any suggestions/solutions will be appreciated.

    Secondly...each time the form is opened, i would like to
    make it clear the check boxes...i have tried to set the
    check boxes to false in the On Open event, but i am an
    access amatuer and cant get it to work...

    once again, thanks for any help
    Ben
    ben Guest

  2. #2

    Default Re: sorting/clearing

    You can sort a form by right-clicking the field you wish to sort by (whether
    price, year, etc), and choosing "Sort Ascending". If you want to do it
    programatically:
    Me.OrderBy = "Price"
    Me.OrderByOn = True

    The check boxes are bound to a yes/no field in the table? To clear all the
    boxes each time the form is opened, you could execute an Update query
    statement in the form's Open event. Set the form's On Open property (Event
    tab of the Properties box) to:
    [Event Procedure]
    Click the build button beside this (...) to open the code window. Enter the
    RunSQL line in between the "Private Sub..." and "End Sub":

    Private Sub Form_Open(Cancel As Integer)
    RunSQL "UPDATE [MyTable] SET [MyYesNoField] = False WHERE [MyYesNoField]
    = True;"
    End Sub

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - [url]http://allenbrowne.com/tips.html[/url]
    Reply to the newsgroup. (Email address has spurious "_SpamTrap")

    "ben" <mitchellbhotmail.com> wrote in message
    news:0a9c01c34bde$3cacb400$a001280aphx.gbl...
    > i have a switchboard that i can open several different
    > forms. one form allows me to select records to be
    > displayed on a report through the use of check boxes.
    > I.E. i open the form, check the box of the records that i
    > want to compare, then close the form.
    >
    > I would like to add two features to this form, but i cant
    > figure out how.
    >
    > First and foremost...i would like to be able to reorder
    > each field through the use of a control button. This is
    > similar to what eBay and others use to sort their
    > auctions in ascending/descending order using price, year,
    > etc.......any suggestions/solutions will be appreciated.
    >
    > Secondly...each time the form is opened, i would like to
    > make it clear the check boxes...i have tried to set the
    > check boxes to false in the On Open event, but i am an
    > access amatuer and cant get it to work...
    >
    > once again, thanks for any help
    > Ben

    Allen Browne Guest

  3. #3

    Default Re: sorting/clearing

    I keep getting a compile error. Sytax error when i copy
    the code into the builder...here is everything in the On
    Open Builder:
    I have changed the MyTable and myYesNofield to the
    corresponding form in my database...


    Option Compare Database
    ------------------------------------------------------
    Private Sub Form_Open(Cancel As Integer)

    UPDATE [MyTable] SET [MyYesNoField] = False WHERE
    [MyYesNoField]>= True;

    End Sub
    --------------------------------------------------
    Private Sub Yes_No_Enter()

    End Sub
    --------------------------------------------------
    Private Sub Yes_No_Exit(Cancel As Integer)

    End Sub
    ---------------------------------------------------

    >-----Original Message-----
    >You can sort a form by right-clicking the field you wish
    to sort by (whether
    >price, year, etc), and choosing "Sort Ascending". If you
    want to do it
    >programatically:
    > Me.OrderBy = "Price"
    > Me.OrderByOn = True
    >
    >The check boxes are bound to a yes/no field in the
    table? To clear all the
    >boxes each time the form is opened, you could execute an
    Update query
    >statement in the form's Open event. Set the form's On
    Open property (Event
    >tab of the Properties box) to:
    > [Event Procedure]
    >Click the build button beside this (...) to open the
    code window. Enter the
    >RunSQL line in between the "Private Sub..." and "End
    Sub":
    >
    >Private Sub Form_Open(Cancel As Integer)
    > RunSQL "UPDATE [MyTable] SET [MyYesNoField] = False
    WHERE [MyYesNoField]
    >= True;"
    >End Sub
    >
    >--
    >Allen Browne - Microsoft MVP. Perth, Western Australia.
    >Tips for Access users - [url]http://allenbrowne.com/tips.html[/url]
    >Reply to the newsgroup. (Email address has
    spurious "_SpamTrap")
    >
    >"ben" <mitchellbhotmail.com> wrote in message
    >news:0a9c01c34bde$3cacb400$a001280aphx.gbl...
    >> i have a switchboard that i can open several different
    >> forms. one form allows me to select records to be
    >> displayed on a report through the use of check boxes.
    >> I.E. i open the form, check the box of the records
    that i
    >> want to compare, then close the form.
    >>
    >> I would like to add two features to this form, but i
    cant
    >> figure out how.
    >>
    >> First and foremost...i would like to be able to reorder
    >> each field through the use of a control button. This
    is
    >> similar to what eBay and others use to sort their
    >> auctions in ascending/descending order using price,
    year,
    >> etc.......any suggestions/solutions will be
    appreciated.
    >>
    >> Secondly...each time the form is opened, i would like
    to
    >> make it clear the check boxes...i have tried to set the
    >> check boxes to false in the On Open event, but i am an
    >> access amatuer and cant get it to work...
    >>
    >> once again, thanks for any help
    >> Ben
    >
    >
    >.
    >
    ben Guest

  4. #4

    Default Re: sorting/clearing

    What happened to the RunSQL and the quotes around the statement?

    Also it needs to be one line, i.e. the [MyYesNoField] >= True; is on the
    same line as the WHERE.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - [url]http://allenbrowne.com/tips.html[/url]
    Reply to the newsgroup. (Email address has spurious "_SpamTrap")
    "ben" <mitchellbhotmail.com> wrote in message
    news:00ac01c34c74$206f0590$a101280aphx.gbl...
    > I keep getting a compile error. Sytax error when i copy
    > the code into the builder...here is everything in the On
    > Open Builder:
    > I have changed the MyTable and myYesNofield to the
    > corresponding form in my database...
    >
    >
    > Option Compare Database
    > ------------------------------------------------------
    > Private Sub Form_Open(Cancel As Integer)
    >
    > UPDATE [MyTable] SET [MyYesNoField] = False WHERE
    > [MyYesNoField]>= True;
    >
    > End Sub
    > --------------------------------------------------
    > Private Sub Yes_No_Enter()
    >
    > End Sub
    > --------------------------------------------------
    > Private Sub Yes_No_Exit(Cancel As Integer)
    >
    > End Sub
    > ---------------------------------------------------
    >
    >
    > >-----Original Message-----
    > >You can sort a form by right-clicking the field you wish
    > to sort by (whether
    > >price, year, etc), and choosing "Sort Ascending". If you
    > want to do it
    > >programatically:
    > > Me.OrderBy = "Price"
    > > Me.OrderByOn = True
    > >
    > >The check boxes are bound to a yes/no field in the
    > table? To clear all the
    > >boxes each time the form is opened, you could execute an
    > Update query
    > >statement in the form's Open event. Set the form's On
    > Open property (Event
    > >tab of the Properties box) to:
    > > [Event Procedure]
    > >Click the build button beside this (...) to open the
    > code window. Enter the
    > >RunSQL line in between the "Private Sub..." and "End
    > Sub":
    > >
    > >Private Sub Form_Open(Cancel As Integer)
    > > RunSQL "UPDATE [MyTable] SET [MyYesNoField] = False
    > WHERE [MyYesNoField]
    > >= True;"
    > >End Sub
    > >
    > >--
    > >Allen Browne - Microsoft MVP. Perth, Western Australia.
    > >Tips for Access users - [url]http://allenbrowne.com/tips.html[/url]
    > >Reply to the newsgroup. (Email address has
    > spurious "_SpamTrap")
    > >
    > >"ben" <mitchellbhotmail.com> wrote in message
    > >news:0a9c01c34bde$3cacb400$a001280aphx.gbl...
    > >> i have a switchboard that i can open several different
    > >> forms. one form allows me to select records to be
    > >> displayed on a report through the use of check boxes.
    > >> I.E. i open the form, check the box of the records
    > that i
    > >> want to compare, then close the form.
    > >>
    > >> I would like to add two features to this form, but i
    > cant
    > >> figure out how.
    > >>
    > >> First and foremost...i would like to be able to reorder
    > >> each field through the use of a control button. This
    > is
    > >> similar to what eBay and others use to sort their
    > >> auctions in ascending/descending order using price,
    > year,
    > >> etc.......any suggestions/solutions will be
    > appreciated.
    > >>
    > >> Secondly...each time the form is opened, i would like
    > to
    > >> make it clear the check boxes...i have tried to set the
    > >> check boxes to false in the On Open event, but i am an
    > >> access amatuer and cant get it to work...
    > >>
    > >> once again, thanks for any help
    > >> Ben
    > >
    > >
    > >.
    > >

    Allen Browne Guest

  5. #5

    Default Re: sorting/clearing

    The quotes and the RunSQL are gone because I changed
    everything around trying to get it to work, and that was
    the last combination I tried...

    I re-entered the code, all on one line, as shown below:

    RunSQL "UPDATE [Shaft Description Data Form - BEN Query -
    Selection] SET [Yes/No] = False WHERE [Yes/No]= True;"

    when i run it, it gives a compile error: sub not defined

    how do i fix this?
    ben
    >-----Original Message-----
    >What happened to the RunSQL and the quotes around the
    statement?
    >
    >Also it needs to be one line, i.e. the [MyYesNoField] >=
    True; is on the
    >same line as the WHERE.
    >
    >--
    >Allen Browne - Microsoft MVP. Perth, Western Australia.
    >Tips for Access users - [url]http://allenbrowne.com/tips.html[/url]
    >Reply to the newsgroup. (Email address has
    spurious "_SpamTrap")
    >"ben" <mitchellbhotmail.com> wrote in message
    >news:00ac01c34c74$206f0590$a101280aphx.gbl...
    >> I keep getting a compile error. Sytax error when i copy
    >> the code into the builder...here is everything in the
    On
    >> Open Builder:
    >> I have changed the MyTable and myYesNofield to the
    >> corresponding form in my database...
    >>
    >>
    >> Option Compare Database
    >> ------------------------------------------------------
    >> Private Sub Form_Open(Cancel As Integer)
    >>
    >> UPDATE [MyTable] SET [MyYesNoField] = False WHERE
    >> [MyYesNoField]>= True;
    >>
    >> End Sub
    >> --------------------------------------------------
    >> Private Sub Yes_No_Enter()
    >>
    >> End Sub
    >> --------------------------------------------------
    >> Private Sub Yes_No_Exit(Cancel As Integer)
    >>
    >> End Sub
    >> ---------------------------------------------------
    >>
    >>
    >> >-----Original Message-----
    >> >You can sort a form by right-clicking the field you
    wish
    >> to sort by (whether
    >> >price, year, etc), and choosing "Sort Ascending". If
    you
    >> want to do it
    >> >programatically:
    >> > Me.OrderBy = "Price"
    >> > Me.OrderByOn = True
    >> >
    >> >The check boxes are bound to a yes/no field in the
    >> table? To clear all the
    >> >boxes each time the form is opened, you could execute
    an
    >> Update query
    >> >statement in the form's Open event. Set the form's On
    >> Open property (Event
    >> >tab of the Properties box) to:
    >> > [Event Procedure]
    >> >Click the build button beside this (...) to open the
    >> code window. Enter the
    >> >RunSQL line in between the "Private Sub..." and "End
    >> Sub":
    >> >
    >> >Private Sub Form_Open(Cancel As Integer)
    >> > RunSQL "UPDATE [MyTable] SET [MyYesNoField] =
    False
    >> WHERE [MyYesNoField]
    >> >= True;"
    >> >End Sub
    >> >
    >> >--
    >> >Allen Browne - Microsoft MVP. Perth, Western
    Australia.
    >> >Tips for Access users -
    [url]http://allenbrowne.com/tips.html[/url]
    >> >Reply to the newsgroup. (Email address has
    >> spurious "_SpamTrap")
    >> >
    >> >"ben" <mitchellbhotmail.com> wrote in message
    >> >news:0a9c01c34bde$3cacb400$a001280aphx.gbl...
    >> >> i have a switchboard that i can open several
    different
    >> >> forms. one form allows me to select records to be
    >> >> displayed on a report through the use of check
    boxes.
    >> >> I.E. i open the form, check the box of the records
    >> that i
    >> >> want to compare, then close the form.
    >> >>
    >> >> I would like to add two features to this form, but i
    >> cant
    >> >> figure out how.
    >> >>
    >> >> First and foremost...i would like to be able to
    reorder
    >> >> each field through the use of a control button.
    This
    >> is
    >> >> similar to what eBay and others use to sort their
    >> >> auctions in ascending/descending order using price,
    >> year,
    >> >> etc.......any suggestions/solutions will be
    >> appreciated.
    >> >>
    >> >> Secondly...each time the form is opened, i would
    like
    >> to
    >> >> make it clear the check boxes...i have tried to set
    the
    >> >> check boxes to false in the On Open event, but i am
    an
    >> >> access amatuer and cant get it to work...
    >> >>
    >> >> once again, thanks for any help
    >> >> Ben
    >> >
    >> >
    >> >.
    >> >
    >
    >
    >.
    >
    ben Guest

  6. #6

    Default Re: sorting/clearing

    Okay: try adding "DoCmd." in front, i.e.:
    DoCmd.RunSql "UPDATE

    I presume you really do have a field named "Yes/No".

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - [url]http://allenbrowne.com/tips.html[/url]
    Reply to the newsgroup. (Email address has spurious "_SpamTrap")

    "ben" <mitchellbhotmail.com> wrote in message
    news:00cb01c34c85$855a6100$a401280aphx.gbl...
    > The quotes and the RunSQL are gone because I changed
    > everything around trying to get it to work, and that was
    > the last combination I tried...
    >
    > I re-entered the code, all on one line, as shown below:
    >
    > RunSQL "UPDATE [Shaft Description Data Form - BEN Query -
    > Selection] SET [Yes/No] = False WHERE [Yes/No]= True;"
    >
    > when i run it, it gives a compile error: sub not defined
    >
    > how do i fix this?
    > ben
    >
    > >-----Original Message-----
    > >What happened to the RunSQL and the quotes around the
    > statement?
    > >
    > >Also it needs to be one line, i.e. the [MyYesNoField] >=
    > True; is on the
    > >same line as the WHERE.
    > >
    > >--
    > >Allen Browne - Microsoft MVP. Perth, Western Australia.
    > >Tips for Access users - [url]http://allenbrowne.com/tips.html[/url]
    > >Reply to the newsgroup. (Email address has
    > spurious "_SpamTrap")
    > >"ben" <mitchellbhotmail.com> wrote in message
    > >news:00ac01c34c74$206f0590$a101280aphx.gbl...
    > >> I keep getting a compile error. Sytax error when i copy
    > >> the code into the builder...here is everything in the
    > On
    > >> Open Builder:
    > >> I have changed the MyTable and myYesNofield to the
    > >> corresponding form in my database...
    > >>
    > >>
    > >> Option Compare Database
    > >> ------------------------------------------------------
    > >> Private Sub Form_Open(Cancel As Integer)
    > >>
    > >> UPDATE [MyTable] SET [MyYesNoField] = False WHERE
    > >> [MyYesNoField]>= True;
    > >>
    > >> End Sub
    > >> --------------------------------------------------
    > >> Private Sub Yes_No_Enter()
    > >>
    > >> End Sub
    > >> --------------------------------------------------
    > >> Private Sub Yes_No_Exit(Cancel As Integer)
    > >>
    > >> End Sub
    > >> ---------------------------------------------------
    > >>
    > >>
    > >> >-----Original Message-----
    > >> >You can sort a form by right-clicking the field you
    > wish
    > >> to sort by (whether
    > >> >price, year, etc), and choosing "Sort Ascending". If
    > you
    > >> want to do it
    > >> >programatically:
    > >> > Me.OrderBy = "Price"
    > >> > Me.OrderByOn = True
    > >> >
    > >> >The check boxes are bound to a yes/no field in the
    > >> table? To clear all the
    > >> >boxes each time the form is opened, you could execute
    > an
    > >> Update query
    > >> >statement in the form's Open event. Set the form's On
    > >> Open property (Event
    > >> >tab of the Properties box) to:
    > >> > [Event Procedure]
    > >> >Click the build button beside this (...) to open the
    > >> code window. Enter the
    > >> >RunSQL line in between the "Private Sub..." and "End
    > >> Sub":
    > >> >
    > >> >Private Sub Form_Open(Cancel As Integer)
    > >> > RunSQL "UPDATE [MyTable] SET [MyYesNoField] =
    > False
    > >> WHERE [MyYesNoField]
    > >> >= True;"
    > >> >End Sub
    > >> >
    > >> >--
    > >> >Allen Browne - Microsoft MVP. Perth, Western
    > Australia.
    > >> >Tips for Access users -
    > [url]http://allenbrowne.com/tips.html[/url]
    > >> >Reply to the newsgroup. (Email address has
    > >> spurious "_SpamTrap")
    > >> >
    > >> >"ben" <mitchellbhotmail.com> wrote in message
    > >> >news:0a9c01c34bde$3cacb400$a001280aphx.gbl...
    > >> >> i have a switchboard that i can open several
    > different
    > >> >> forms. one form allows me to select records to be
    > >> >> displayed on a report through the use of check
    > boxes.
    > >> >> I.E. i open the form, check the box of the records
    > >> that i
    > >> >> want to compare, then close the form.
    > >> >>
    > >> >> I would like to add two features to this form, but i
    > >> cant
    > >> >> figure out how.
    > >> >>
    > >> >> First and foremost...i would like to be able to
    > reorder
    > >> >> each field through the use of a control button.
    > This
    > >> is
    > >> >> similar to what eBay and others use to sort their
    > >> >> auctions in ascending/descending order using price,
    > >> year,
    > >> >> etc.......any suggestions/solutions will be
    > >> appreciated.
    > >> >>
    > >> >> Secondly...each time the form is opened, i would
    > like
    > >> to
    > >> >> make it clear the check boxes...i have tried to set
    > the
    > >> >> check boxes to false in the On Open event, but i am
    > an
    > >> >> access amatuer and cant get it to work...
    > >> >>
    > >> >> once again, thanks for any help
    > >> >> Ben
    > >> >
    > >> >
    > >> >.
    > >> >
    > >
    > >
    > >.
    > >

    Allen Browne Guest

Similar Threads

  1. Clearing Results
    By rottmanja in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: March 3rd, 07:14 PM
  2. Clearing the new FLVPlaback
    By andros in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: October 11th, 06:46 PM
  3. Clearing cache?
    By Steve Landavazo in forum Web Design
    Replies: 1
    Last Post: April 24th, 03:20 PM
  4. Clearing the stage
    By Nicollini webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 2
    Last Post: July 16th, 03:52 PM
  5. Odp: Clearing the stage
    By luk in forum Macromedia Director Lingo
    Replies: 0
    Last Post: July 16th, 01:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139