Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 39
  1. #16
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Does this do what you want?

    Code:
      Dim lngVessel               As Long
      If IsNumeric(Me.VesselInspectionID) Then
        lngVessel = Nz(DLookup("VesselID", "tblVesselInspections", "VesselInspectionID = " & Me.VesselInspectionID), 0)
        Me.CmbVsl = lngVessel
        Me.CmbIns.Requery
      End If
      Me.AllowEdits = Me.NewRecord

    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    Yea, that worked great. I'll do a bunch of data entry to see how well it holds up and then get back to you. Thanks again!

  3. #18
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    No problemo! Do I get a free ride on a ship now?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #19
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    Haha only if you are deemed a 100% Not Suspicious Person :-P

  5. #20
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Bummer; I've got the beady eyes that always get me stopped.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #21
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    Haha darn. Well the issues, I am hitting right now are.. The form that you just gave me the code for works in that it lets me see previous entries without having to mess with the combo boxes, but what would the user do if he needs to edit anything? Presently, the date on a previous record cannot be selected.

    Another question I have is what is to be done about repeats? What if someone accidentally re-enters a record?

  7. #22
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Well, this code that you already had in there is stopping edits on existing records:

    Me.AllowEdits = Me.NewRecord

    You can test for duplicates in the before update event of the form, or set an index on the appropriate combination of fields and Access will enforce it for you. I tend to test myself.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #23
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    That worked out. Moving onto building reports and having them calculate when the next inspection is coming up based on the latest inspection record... for each inspection. Gonna be tough. Then, I gotta work on the whole machinery overhaul part of it. Meanwhile.. July 31st is creeping up.

  9. #24
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    My question right now is whether it is better to have a new field in the Inspection Records table that uses the DateCompleted and InspectionInterval fields to calculate the Due Date or should it just be in the report?

  10. #25
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    In similar applications, I just use the most recent date (or mileage) completed and the interval and calculate the next due date/mileage for "due for service" and other reports. I don't have a field for it in any table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #26
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    So I ended up writing my very first SQL query...


    SELECT TblInspectionHistory.VesselInspectionID, Max(TblInspectionHistory.DateCompleted) AS MaxOfDateCompleted
    FROM TblInspectionHistory
    GROUP BY TblInspectionHistory.VesselInspectionID;

    ...and it works wonderfully! Sorts all vesselinspectionIDs by the latest date. Now I get to figure out how to get it to work with the rest of my system..

  12. #27
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    Just an update.. my project has turned into a three headed monster. A manager from another department noticed from what the database is capable of and wants his stuff in there too. And my boss wants the database to handle cost and budgeting, have user logins and relevant scanned documents based on each record entry. All of of this seems possible... I just need to collect my thoughts, put them down on paper and figure out how this is going to work..

  13. #28
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Good luck!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #29
    shariq1989 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    50
    So tomorrow I am sitting down with my boss and kinda showing him a glimpse/overview of how the database will work. Any good guides on creating the first UI screen that pops up, where buttons that lead to forms can be inserted. Not talking about a splash screen but about what comes after one.

  15. #30
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    If you mean style-wise, I'm not the one to ask. I just create forms that provide the desired functionality. I'm not good at making them pretty.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Columns in Combo Box
    By ss2020 in forum Forms
    Replies: 4
    Last Post: 02-17-2012, 04:11 PM
  2. Combos
    By AdventureBob in forum Forms
    Replies: 1
    Last Post: 01-20-2012, 08:54 AM
  3. Turn a list into a Multi select combo box
    By seth1685 in forum Programming
    Replies: 1
    Last Post: 01-11-2012, 07:52 AM
  4. Display 2 Columns in Combo Box?
    By 10 Gauge in forum Forms
    Replies: 3
    Last Post: 04-12-2011, 10:24 AM
  5. Combo Box with multiple columns
    By desireemm1 in forum Access
    Replies: 1
    Last Post: 08-17-2009, 02:36 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