Results 1 to 8 of 8
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    default data from table


    ok, I need some help researching a new idea. I have a form on a split front end that uses default values based on the location that the front end is located. currently I have the default values set in properties and in the code of each front end, but this gets tedious remembering to change all the defaults each time I give them a updated front end and I have been known to forget one or two. what I would like to look into is whether I can make a table in each front end, lets say DefaultT, with the default values for things like location, line and contacts, and have the text boxes and VBA pull from that table for its values. can someone point me in a direction of research or a sample that uses this method. i'm sure this is a common thing but as I am learning as I see needs this is new to me thank you in advance.

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    currently i'm using-
    Private Sub Form_Load()
    Me.OrderBy = "DailyProdID DESC"
    Me.OrderByOn = True
    DoCmd.applyfilter,"lineid=11"
    End Sub

    the "11" represents the line. what I would envision is to pull my value from the table called "default" field name "lineid" which is set to 11. just not sure how to pull the value from a table and then apply it to the filter. can anyone point me in a direction?

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm not real sure I understand what you mean by "Default values".

  4. #4
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    I would like to put the value of 11 in the table "defaultT" field name "lineid" and have the bound text box on my form default to what ever value I put in the table "defaultt", field name "lineid"

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You would probably need to use a DLookup to retrieve the "default" table value.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Does that make any sense ?

  7. #7
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks RuralGuy, I used-
    Private Sub btnNewShift_Click()
    DoCmd.GoToRecord , , acNewRec
    Me.LineID = DLookup("lineid", "defaultT")
    Me.LocationID = DLookup("locationid", "defaultT")
    End Sub

    now what ever value I set in my default table the lineid and locationid sets as a default value, yea. can I also use the dlookup to store a email address in my default table and email a report with the sendobject command to the address that is stored there?

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    DLookup is read only. If that works for you then YES.

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

Similar Threads

  1. Default value from separate table
    By dgtampa in forum Forms
    Replies: 2
    Last Post: 10-31-2011, 07:41 PM
  2. Replies: 1
    Last Post: 09-11-2011, 06:14 PM
  3. Replies: 2
    Last Post: 08-06-2011, 12:19 PM
  4. Table opening by default
    By rod147 in forum Access
    Replies: 1
    Last Post: 07-07-2009, 10:01 AM
  5. Default Value in table = Field plus 3 days
    By AmyLynnHill in forum Access
    Replies: 1
    Last Post: 08-03-2008, 01:58 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