Populating Subform

fireman_gcfd

Registered User.
Local time
Today, 15:53
Joined
Aug 14, 2007
Messages
25
Hello all,

It has been sometime since I have posted on this forum as I have not had much to do with database creation for awhile now. I am working on enhancing our database at work and want it to do certain things but need a gentle nudge as to how I should proceed with things. I will outline what I am wanting to do and hopefully you can point me in the right direction so I can continue on!

I have a form with all employee details which in itself pulls from a few different tables. Now this I am not having the issue with. What I want to do is add a subform that will populate itself from a separate form/table. Now having said that, here is where I am stumped. I want to build a form called "Training" and have it so I can input a training session with all attendees (employees). Once all have been entered, have some code/query separate them into the appropriate employee files.

I hope this is making sense and additionally I hope this can be done without too much banging my head on the desk.

I am by no means looking for someone to build this for me...just looking for advice. I may be overthinking the whole thing too.

Suggestions?

Jaz
 
The attached is not exactly what you are looking for but perhaps it will get you headed in the right direction.

The DB associates films with actors. If you think of the actors as your Courses, and the films as your employees, that should give one way of tackling your problem.
 

Attachments

Thanks for the quick reply. I will pick through that and get back to you in a little bit.

Cheers
 
OK I have posted a DB. This is not a functioning DB! It is a hybrid mish-mash of 2 different sample DB's I came across. To those that are going to view this, here is what I am looking to do with it:

1. Have the form function based on query just as this one does with the info autofilling the fields. The real head scratcher I am having with that is the subform and getting the appropriate individuals information to correspond with the select person. **Now having said that if there ideas of how to do it without the subform I am open to ALL ideas!!

2. I like the browse function...enough said :)

3. I have labled the main form so as to show the layout/format I am looking for.

4. There are a great deal of fields that I have hidden that are required for the queries and modules to work.

Looking forward to hearing from all of you.

Jaz
 

Attachments

OK I've had a look and a play and come up with something completely different ;) but hopefully headed in the the direction you're after.

Sorry for the delay it's been a busy week.
 

Attachments

John, that's a great piece you threw together. I am looking to do something similar where you type in a name and a subform populates with the possible matches. Quick question, for that piece of the trick, do I just need the event from the unbound text box and the query that populates the subform - or are there added things in there?
 
John, that's a great piece you threw together. I am looking to do something similar where you type in a name and a subform populates with the possible matches. Quick question, for that piece of the trick, do I just need the event from the unbound text box and the query that populates the subform - or are there added things in there?

There are a couple of little tricks in there as well, if you have a look at Post 6 in this thread you will find step by step instructions on how to put it all together. Post 8 from the same thread has detailed comments inserted into the code, which you will find in the On Change Event for Text0 (the visible text box).

This set up is based on search functionality that was discussed some time ago on this forum, which I have bashed to meet my own ends.
 
John

Sorry for the delay. I have been away.

That is EXACTLY what I was looking for. You're a life saver man!

Thank you so much!

Jaz
 
I have a follow up question. For the code below, the field that is the link criteria is a TEXT field. DO I have to change DIM ... As String? (Sorry for the rookie question).

Private Sub List2_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_mssbac"

stLinkCriteria = "[acct_nbr]=" & Me![List2]
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , "Edit"
 
In John_Big_Booty's absence, yes your strLinkCriteria must be a string as that's what the argument (related to that criteria) in the OpenForm method accepts.

By the way, you could write that directly into the OpenForm event. The only reason you're saving that into strLinkCriteria is for readability.
 
Hmmm.... I changed [acct_nbr] from NUMBER to TEXT, and what happend was when I double clicked on the record, the form opened but in ADD mode, note EDIT of the record I selected.

I assumed this had something to do with the link criteria. Any ideas?
 
Let's move this to another thread and I'll give you an answer.
 

Users who are viewing this thread

Back
Top Bottom