Results 1 to 8 of 8
  1. #1
    pshoestir is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    11

    Different default values for different forms

    I am trying to create an access form that will automatically default one of the bound table fields to a specific value. Basically here is a simplified explanation of the setup; I have a "Purchase Order" table that is bound to the form. One of the fields in the Purchase Order table is a combo box linked to another table called "Plant Location". Currently there are only two items in the Plant Location table, a FL and a GA. I am going to create two forms, a "FL Purchase Order" and a "GA Purchase Order" one. What I need help with is figuring out how to have the FL Purchase Order form default the Plant Location to FL and have the GA Purchase Order form default the Plant Location to GA. Could someone please offer advice on how to accomplish this.



    Thanks in advance,

    PS

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Why have different forms, rather than a single form where you chose the location? I'd say the same thing about tables, if you have separate tables for them.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pshoestir is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    11
    I am having all of the Purchase Orders go to the same table, both FL and GA. There are several reasons for doing this, mainly because of who my end users are.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    I have a table, tConfig. I set my defaults here, so when the person gets it , the app reads this 1st.

    For you, you can do this , or set the combo for FL for 1 group before you send it to them,
    set the other to GA before sending theirs.

  5. #5
    pshoestir is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    11
    Isn't there some VBA code to force the value that I want?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Quote Originally Posted by pshoestir View Post
    I am having all of the Purchase Orders go to the same table, both FL and GA. There are several reasons for doing this, mainly because of who my end users are.
    You may have misunderstood, as that's what I would recommend: a single table with a field for location. I'd have a single form, and set the value in some way appropriate to your app. For instance if they clicked on a "FL" button, I'd open the form and then set the value:

    DoCmd.OpenForm "FormName"
    Forms!FormName.TextboxName = "FL"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    pshoestir is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    11
    Let me give that a whirl and see how it goes. Thanks for the help!

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No problem, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Default Values/Forms/Macros?
    By sivega in forum Access
    Replies: 1
    Last Post: 07-26-2013, 02:05 PM
  2. Replies: 5
    Last Post: 06-05-2013, 05:59 PM
  3. Replies: 3
    Last Post: 07-30-2011, 09:12 PM
  4. Default Forms
    By BigCat in forum Forms
    Replies: 10
    Last Post: 06-09-2011, 03:36 PM
  5. Default Values
    By twainscott in forum Programming
    Replies: 0
    Last Post: 09-14-2006, 11:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums