Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2009
    Posts
    32

    Unanswered: A form change its record set based on switchboard selection

    So i want to have a switchboard with like 5 different buttons... each assosiated with a query or table... and I want the form it opens to change its recordset based on what was selected... so that the dropdowns on the forms have different data depending on what was selected...

    Im rambling... but I think its possible, probably needs some VB code of some kind but im not sure where to start... anyone know how to do this or a good web site that talkes about it?

    Thank!

    BottledFury

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so design your queries/forms/reports/table and so on
    then open your switchboard in design mode
    then add the fucntions you want.
    you can do this also by editing the data directly. you need to do a bit of investigation to find out what the various commands and values mean but it can be done.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    Switchboards are handled slightly differently from normal forms. There is a Database Utility (see Database Window Menu) called Switchboard Manager where you can nominate what happens when a button is pressed. For what you need, I suggest selecting the option to run a VBA function which modifies your settings then opens the form.
    If you want to change the data shown in the form, then each variant should have a query associated with it. Then, when you press a button on the switchboard, the VBA function will open the form and assign the appropriate query to the RecordSource property. If, on the other hand, you are looking to change the selectable items in various combo boxes and list boxes, the technique is much the same. You create SQL queries as strings in VBA and assign them to the RowSource in the appropriate controls.

  4. #4
    Join Date
    Nov 2009
    Posts
    32

    Lightbulb Perhaps a silly Mistake

    Yes yes very good... I have been trying to do this

    I have a statement attached to switchboard option

    DoCmd.OpenForm NameOfForm, acNormal, qryNameHere

    When i run it it the compiler throws up on me and says

    Run-Time Errror 2494
    The action or method requires a Form Name argument
    ??

  5. #5
    Join Date
    Nov 2009
    Posts
    32

    Duh

    Had to put FormName in " "

    lol

Tags for this Thread

Posting Permissions

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