Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
  1. #16
    captike is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2022
    Location
    Alachua, FL
    Posts
    16

    Ok, I'll give that a whirl.

  2. #17
    captike is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2022
    Location
    Alachua, FL
    Posts
    16
    Ok, when I put that into the record source for the form and switch to Form View, I get an error that says Syntax Error in FROM clause. I attached what I typed in the record source. Just a note, I changed the name of the Description field since it was a reserved word. It's now called MaintenanceDescription.

    Additionally, I see what the code is aiming to do, but how does it tie a given text box on the form to a unique EquipmentID? I'm lost on that part.Click image for larger version. 

Name:	Error.JPG 
Views:	24 
Size:	30.7 KB 
ID:	47569

  3. #18
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    It was freetyped as I don't have your data and not clear what the syntax error actually is. A screenshot of the error would be more helpful - or provide a small db with some relevant data in it.

    equipmentID? Ah I see you need it because you have two bits of equipment in the same unit and position, so add

    tblEquipment.equipmentID

    to your select query

    You might also need to add property number as well

    Edit - when I copy pasted the code I missed the ON part

    Code:
    SELECT Unit, Position, M.equipmentID is not null as Serviced
    FROM tblEquipment LEFT JOIN (SELECT DISTINCT EquipmentID FROM tblMaintenance  WHERE year(MaintenanceDate)=year(date()) AND Description='Annual Service Complete') as M
    ON tblEquipment.EquipmentID=m.EquipmentID

  4. #19
    captike is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2022
    Location
    Alachua, FL
    Posts
    16
    I put the new code in the Record source and the error is now gone, so I definitely feel like I'm making progress. (I attached the code I used) I can also put "Serviced=True" in the conditional format box and it pops up in the Intellisense format so that has to be good, right? Now, I can't figure out where to go from here to get the text boxes on the form to relate to a specific pack. I attached the beginning stage of the form I want designed with the text boxes on it. So, for the first box under Engine 12 should be the LT pack assigned to that unit..in this case it would be EquipmentID=9, but if I put that in the control source, I get the #Name? error on the form. So, how do I assign a given text box (with the conditional format of Serviced=True) to a specific pack?
    Click image for larger version. 

Name:	Select.JPG 
Views:	23 
Size:	33.1 KB 
ID:	47579Click image for larger version. 

Name:	Form Layout.JPG 
Views:	22 
Size:	131.5 KB 
ID:	47580

  5. #20
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    Doesn’t look like you have a normalised form

  6. #21
    captike is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2022
    Location
    Alachua, FL
    Posts
    16
    I'm not familiar with that term with regards to forms...what does that mean and how should I normalize it?

  7. #22
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    you are using unbound controls. I would expect you to use a continuous form or a report per post #6. To get your design in post #1 each 'box' would be a continuous subform/report on a main form/report

  8. #23
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Maybe post your dB? It would be easier than playing 20 questions......


    I'm not familiar with that term with regards to forms...what does that mean and how should I normalize it?
    Happy reading....

    What is Normalization? (Parts 1 - 5)
    =======================
    Part I: Why Normalization?
    Part II: Break it up.
    Part III: Putting It Back Together
    Part IV: More Relationships
    Part V: Many-to-Many Relationships


    The Normal Forms
    =========================
    Introduction
    First Normal Form (1NF)
    Second Normal Form (2NF)
    Third Normal Form (3NF)
    In a Nutshell
    Try for at least 3NF...




    The test is on Friday

  9. #24
    captike is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2022
    Location
    Alachua, FL
    Posts
    16
    Quote Originally Posted by Ajax View Post
    you are using unbound controls. I would expect you to use a continuous form or a report per post #6. To get your design in post #1 each 'box' would be a continuous subform/report on a main form/report
    Ok, I think I'm tracking. So, for each box (or physical truck) what would the five positions fields be bound to? The position name field (LT, D/O, FF1, etc) or the equipmentID's. I don't need any information from the table in them other than the position names.

    Quote Originally Posted by ssanfu View Post
    Maybe post your dB? It would be easier than playing 20 questions......




    Happy reading....

    What is Normalization? (Parts 1 - 5)
    =======================
    Part I: Why Normalization?
    Part II: Break it up.
    Part III: Putting It Back Together
    Part IV: More Relationships
    Part V: Many-to-Many Relationships


    The Normal Forms
    =========================
    Introduction
    First Normal Form (1NF)
    Second Normal Form (2NF)
    Third Normal Form (3NF)
    In a Nutshell
    Try for at least 3NF...




    The test is on Friday
    I tried to attach the db file, but it says it exceeds the file limit. Is a Dropbox or Google Drive link ok?
    And I love the reading!! Thanks for that....I'll do my best to be prepared for Friday's test.

  10. #25
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    not for me, I will only download from the forum.

    Remove tables/forms/reports not relevant to your question. then compact, finally zip and upload.

  11. #26
    captike is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2022
    Location
    Alachua, FL
    Posts
    16
    Here you go. Thanks again for helping me out.
    Attached Files Attached Files

  12. #27
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    based on what is provided, in attached see a new qry and report called qryServiceStatus and rptServiceStatus. The latter is based on the former. It produces this result
    Click image for larger version. 

Name:	Capture.JPG 
Views:	13 
Size:	15.1 KB 
ID:	47591
    Attached Files Attached Files

  13. #28
    captike is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2022
    Location
    Alachua, FL
    Posts
    16
    YES!! From here it sure looks like you nailed it! I'll unpack that tomorrow at work and see how you did it. Until then, I'm still studying my homework. Thank you, thank you, thank you! You're amazing!

  14. #29
    captike is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Mar 2022
    Location
    Alachua, FL
    Posts
    16
    I've made the provided changes and after some testing it works with one problem. If there is another maintenance type record (say Repaired, for instance) the Unit doesn't show up on the report at all. The unit will only show up (in red) if the maintenance for that pack is completely empty. If there is a maintenance record for something other than PM, they're not listed. I'm guessing this is a change in the query, but I've tried several iterations and can't nail it down.

  15. #30
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    Always better to provide data which truly reflects the real life situation. You need a different type of query

    Code:
    SELECT tblEquipment.Unit, tblEquipment.Position, [c].[equipmentID] Is Not Null AS serviced
    FROM tblEquipment LEFT JOIN (SELECT tblMaintenance.EquipmentID
    FROM tblMaintenance
    WHERE (((tblMaintenance.MaintenanceType)="PM") AND ((Year([MaintenanceDate]))=Year(Now()))))  AS C ON tblEquipment.EquipmentID = C.EquipmentID
    WHERE (((tblEquipment.Unit) Is Not Null));

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

Similar Threads

  1. Replies: 7
    Last Post: 03-03-2018, 05:08 PM
  2. Replies: 2
    Last Post: 02-14-2017, 02:23 AM
  3. Replies: 2
    Last Post: 11-12-2015, 10:46 AM
  4. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  5. Visual Formatting Glitches on Report
    By trb5016 in forum Reports
    Replies: 0
    Last Post: 07-29-2010, 09:33 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