Results 1 to 8 of 8
  1. #1
    TRexMedic is offline Novice
    Windows 10 Office 365
    Join Date
    Dec 2023
    Posts
    1

    Form-subform from listbox

    All right all. I am probably completely over thinking this, but at this point it is time to consult the experts. One thing to keep in mind is that I am very new to access.
    I am in the process of creating a DB for my fire department. I am tracking our training among other things in the DB. However, I am focusing on the training for this thread. I have created a table for each firefighter for training as well as a table for the overall roster. I have created a listbox on a form that pulls first name, last name, rank, and training file name from the roster table.

    Here is where I get lost. Once I select the firefighter from the listbox, I want it to pull the first name, last name, and rank from the Roster table an populate a form or report with this information. Then pull the data from the firefighter's training file and populate a subform or subreport under the previous information.

    any assistance would be GREATLY appreciated.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    "table for each firefighter for training" - do you really mean a single table with all firefighters training?

    If you want to provide db for analysis, follow instructions at bottom of my post.

    Example of a "search" form http://allenbrowne.com/ser-62.html

    Training database is a common topic, review
    https://answers.microsoft.com/en-us/...2-ed56fa461560
    https://access-templates.com/tutoria...ms-access.html
    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
    Salty Mariner is offline Intermediate
    Windows 11 Access 2021
    Join Date
    Dec 2023
    Location
    Corpus Christi, TX
    Posts
    69
    Quote Originally Posted by TRexMedic View Post
    All right all. I am probably completely over thinking this, but at this point it is time to consult the experts. One thing to keep in mind is that I am very new to access.
    I am in the process of creating a DB for my fire department. I am tracking our training among other things in the DB. However, I am focusing on the training for this thread. I have created a table for each firefighter for training as well as a table for the overall roster. I have created a listbox on a form that pulls first name, last name, rank, and training file name from the roster table.

    Here is where I get lost. Once I select the firefighter from the listbox, I want it to pull the first name, last name, and rank from the Roster table an populate a form or report with this information. Then pull the data from the firefighter's training file and populate a subform or subreport under the previous information.

    any assistance would be GREATLY appreciated.
    I created something very similar to what you are tying to do with a form for my crew and a subform for their "documents" many of which are training certificates. You should be able to accomplish this with 3-4 tables here is a snip of my relationships.

    Click image for larger version. 

Name:	Screenshot 2023-12-25 235618.png 
Views:	24 
Size:	16.9 KB 
ID:	51254


    I have a form for my crew and a subforum for their documents with conditional formatting to show expiring within 90 days, 30 days and expired. I don't allow editing on the subform but have the user double-click on the document name to open a another form that allows for new records and edits. when that form closes it requeries the calling form to update the record. See below for the main form and the document editing form.
    Click image for larger version. 

Name:	Screenshot 2023-12-25 233822.png 
Views:	23 
Size:	54.5 KB 
ID:	51257

    Substitute "firemen" for "Crew", and "Training" for "Documents" and something like this sounds close to what you are tying to do.

    BTW, you posted this question of Forms in the Reports forum.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Nice DB there Salty, you need to bump that Novice tag up some .

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Don't expiry dates tend to be 1 day less that the start date plus the duration length?

    IE 04/22/2022 would expire 04/21/2026
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I'd say it depends on one's interpretation of expiry. If you have a coupon that expires 10/31/2023 you can usually use it up to close of business on that day. It doesn't expire the day before at close of business. At least that's how it is over here.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Salty Mariner is offline Intermediate
    Windows 11 Access 2021
    Join Date
    Dec 2023
    Location
    Corpus Christi, TX
    Posts
    69
    Quote Originally Posted by Welshgasman View Post
    Don't expiry dates tend to be 1 day less that the start date plus the duration length?

    IE 04/22/2022 would expire 04/21/2026
    In the case of the example that I posted those dates were pulled directly from what was printed on the crewman's certificates. Some certificates only have a date of issue. while others have both a DOI and DOE. and still others only list an expiration date. The best we can do is to take verbatim whatever is typed on someone's certificate.

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Micron View Post
    I'd say it depends on one's interpretation of expiry. If you have a coupon that expires 10/31/2023 you can usually use it up to close of business on that day. It doesn't expire the day before at close of business. At least that's how it is over here.
    Yes, that is how car isnurance works over here, but it would have started on 11/01/2022.

    However, if that is what is on the certificate, that should be used. Still not sure they did their math correct on that though?
    A common mistake (IMO) that I have seen countless times.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 8
    Last Post: 03-05-2016, 10:39 AM
  2. Replies: 3
    Last Post: 10-19-2015, 03:16 PM
  3. Replies: 1
    Last Post: 01-31-2015, 09:03 PM
  4. Replies: 5
    Last Post: 06-23-2014, 03:32 PM
  5. Replies: 1
    Last Post: 03-15-2011, 03:53 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