Results 1 to 8 of 8
  1. #1
    mschmucker is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6

    Question Default value in a form Access 2010

    I have an Access 2010 database to track detail trips on our trucks. I am using a form to enter the data. I would like the beginning hub auto filled in based on the ending hub from the previous record. I can do this using after update function, my problem is when I exit the form then go back in, the first line of data entry for that day does not have the beginning hub filled in. It there a way to do this that the beginning hub is always auto filled in? Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    There is a post #2 here with a similar concept --- last event finish value ---becomes next event starting value.

    It deals with fuel meter reading and there is a demo database.
    Hope it is helpful to you.

  3. #3
    mschmucker is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6
    I have 13 trucks and am using a different form for each truck. The code attached looks back to the table to get a max number, and all my trucks have different hubs. I need it to look at only the form. Unless there is a way to return the ending hub to the next record beginning hub for a specific truck. Thanks

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Can you post a jpg of your tables and relationships (printscreen of relationships window)?

    Why is there a different form for each truck?

    Forms don't store data ---Tables are where data is stored.

  5. #5
    mschmucker is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6
    Click image for larger version. 

Name:	Miles.jpg 
Views:	10 
Size:	87.8 KB 
ID:	19590

    I am using a different form for each truck so I could look at the ending hub. I would love to only use one form for all trucks if there was a way for the beginning hub to be auto filled in correctly for each different truck.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    What exactly is the purpose of the database and does it share data with any other application?

    Is this an operational application or are you just starting development?

    Do you have a statement of requirements, or a description of the proposed database
    in plain English? All the things and processes involved in business terms? If so, could you please post/attach as appropriate.

    Have you tested your model with test data and scenarios to see if you can get the information you need?

    Your tables don't appear to have fields I would have expected.
    tblTrucks (TruckId, ExpDepartment, Disposed)??

  7. #7
    mschmucker is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6
    Purpose: We need to track all miles driven for IRP and IFTA reasons. We also use it to track miles to customer for billing purposes and track miles for incoming product so we can see how many miles we drive to pick up different types of product. We use it to schedule maintenance on trucks and trailers based on the amount of miles we drive. We use it to pay our drivers. We pay based on miles driven and number of trips.

    This is a new application. I am currently using a combo of Excel and Access and I want to move everything to Access.

    My Table "Trucks" lists all my trucks, what department they are in - we track our miles and expenses separately between outbound and inbound trucks- and disposed so that if we sell or retire a truck I can remove it from the list of available trucks.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I don't know what these are ( IRP and IFTA) but am guessing it is some government regulation.

    You mention Customer and Department but I don't see tables for these in your picture.

    How do you
    schedule maintenance on trucks and trailers
    from this model?
    I don't think you have a model that reflects what you wrote in post #6.
    Getting your tables and fields identified and designed is key to getting your database to support your business.

    Here's a free generic data model on Vehicle Maintenance showing some typical tables and fields involved.

    Good luck with your project

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

Similar Threads

  1. MS Word 2010 Form to MS Access 2010 table
    By Aprilhm14 in forum Forms
    Replies: 3
    Last Post: 11-03-2014, 01:49 PM
  2. Replies: 6
    Last Post: 07-07-2014, 09:13 AM
  3. Replies: 7
    Last Post: 08-12-2013, 08:28 AM
  4. Replies: 1
    Last Post: 08-09-2013, 02:23 PM
  5. Replies: 0
    Last Post: 07-31-2012, 12:25 PM

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