Results 1 to 6 of 6
  1. #1
    Mtyetti2 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    26

    Vehicle Mileage

    I'm in need of some desperate help here. Hopefully I can describe this correctly. I have a multiple Aircraft database. At the heart of it, is the 'TachTime' which is like an odometer in a car. I need to somehow display the current TachTime in a text box for the Aircraft which is selected from a combo box. I do have a query setup which will query the TachTime for the AircraftID in the combo box. However, if I set that query as the data source, all I get is a "#Name?" error. I have also tried DLookup which also returns the "#Name?" Here is what the DLookup looks like:=DLookUp([TachIn],[Tach_Q]) Any help would be much appreciated. I need to be able to populate this value, which will eventually tie into many other features like maintenance tracking, etc. Thank you so much everyone!! Scott

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Must enclose references in quote marks.

    =DLookUp("[TachIn]", "[Tach_Q]")

    However, that will return the first TackIn value encountered. You probably need some criteria.

    What do you mean by 'current' tach time - the latest in table?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Mtyetti2 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    26
    Looks like that fixed it! All I needed was the quotes, and I get he value now! I have the query criteria set to 'decreasing' and return 1 value. That way, it does return the latest TachTime for the given aircraft. Is there a way you can think to do this without customizing a query for every form that I want to include it on? Would it make sense to somehow just include the code in the DLookup itself??? Again, thank you so much, June7

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    What do you mean by 'every form'? How many forms do you need this same data on?

    Yes, the criteria can be included in the DLookup but could be a little complicated in this case. What is the data in TachIn field? And what is TachTime you reference in your post - did you mean the TachIn field?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Mtyetti2 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    26
    For example, I have an Aircraft Maintenace form, which I would like for the current tach time to feed this form. (which would be the latest TachIn entry for the given aircraft on the maintenace form) I plan on using this 'current tach' number to populate reports as well.
    For record keeping, I need to store each Event's TachIn and TachOut in the Event Table. But I feel like the the current tach should be stored in the Aircraft table. Would this be duplicating data?? If it should also be stored in the aircraft table, I'm not sure how to make that data appear there. And if it should not be stored there, do I need to customize a DLookup function to calculate the value each time I need it? (maintenance tracking, etc)
    I hope this description makes sense. :/
    The TachIn and TachOut fields are numbers. And yes, when I referred to TachTime, I meant the latest TachIn.

    Thank you so much!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Ideally, would not store the TachIn and TachOut data in the Aircraft table as this duplicates data in the Events table. Would retrieve the latest TachIn/TachOut values from Events by some method (DLookup, VBA code).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Full App - Mileage/Timesheet Example
    By pkstormy in forum Sample Databases
    Replies: 9
    Last Post: 05-27-2015, 03:37 PM
  2. Vehicle Mileage Database
    By Mtyetti2 in forum Access
    Replies: 6
    Last Post: 10-07-2013, 01:50 PM
  3. Vehicle inventory/assignment
    By jzacharias in forum Database Design
    Replies: 2
    Last Post: 10-11-2012, 02:39 PM
  4. Mileage App
    By neo651 in forum Access
    Replies: 1
    Last Post: 06-01-2012, 03:29 PM
  5. Database for Mileage Reports
    By luvsmel in forum Database Design
    Replies: 1
    Last Post: 03-21-2012, 10:07 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