dropdown list to depend on other field

Hi Everyone...it's slowly coming along; however, I'm still having the same problems of the subforms (have 3 now) NOT clearing when I navigate to a new record on the MAIN form (frm_Freelancer_Information). I added the following code on the sfrm_Freelancer's_Languages subform to see if it would work (didn't bother adding anything for the other 2 subforms since it didn't work for this one):

Private Sub Form_Current()
Me.lsb_Languages.Requery
End Sub

I also can't figure out how to retain the multiple selections for the saved records once I exit the form and then return to it. Since the listboxes are each based on queries and the selections are sent to junction tables, I don't know how to get the results from the junction tables to show back up on the form when we attempt to review the freelancer's record.

Like I stated in my previous post, it's doing what I want it to do...retaining & clearing the listboxes; however, it's doing so at the exact opposite time I need for it to do each one.

I've attached an updated copy of the database. I hope one of you can figure this out.

Thanks,
USEN

P.S. Thanks to you all, my Employer was very pleased with my progress when we met on Monday morning.
 

Attachments

You can not bind a multiselect listbox to a field or table; it always returns Null. As I mentioned earlier, I typically let them add records with the listbox, but present them for viewing/editing with a subform.

If you want to present the existing choices with a listbox, there will be some code involved, and it will get tricky to keep track of additions/deletions by the user. Basically when they go to a freelancer record you have to get that person's current selections and cycle through the listbox in code to select each appropriate item. Then when they leave that record, you have to code to add any newly selected items and delete any that were unselected.
 
Hi Paul,

You've completely lost me now. The multiselect listbox IS already in a subform. It's this subform that isn't reflecting those selections when we return to the Main form which contains that subform. Are you perhaps saying that I need an additional subform in which to view the results of that multiselect listbox selections that are sent to the junction table (which is the tbl_Freelancer's_Languages for this particular example)? If so, what I'll have is a subform containing the listbox which queries the complete list of languages (from the tbl_Languages) & a command button that sends those selections to the junction table...and then another subform which will query that same junction table and send the results back to the original form for view purposes only?

Regardless of how this may or may not work, I still need to figure out how to get the subform to clear when navigating the main form to a new record. The code which I wrote isn't working. I have a feeling that it's because the code is for the subform whereas it's the main form which navigates to the new record. Perhpas if I end up with the above mentioned "additional" subform to enable viewing of the selections, I can place some code which clears the listbox as an event procedure when that form "deactivates" or "loses the focus"? I'm not certain what this event is named.

If these ideas would work, I need help with the codes for both procedures.

I'm DEFINITELY in your debt...lol!

USEN
 
Well, the listbox is on a subform, but the subform does not display any of the fields from the table. Hang on, let me rough something out that might make it clearer.
 
All right, this is very quick and dirty, but maybe gives you some ideas. The subform includes the listbox and displays the selected items, which you can then edit. The displayed items should update when you add items through the listbox. The listbox clears on change of records.
 

Attachments

Thanks Paul! Take you time, I'm not in a big rush at the moment.

Also, while I realize posting my questions to this forum benefits many, I have a rather complicated situation coming up in this project that would take pages upon pages to try to ask & explain. Is there any way that we can meet on Skype, Yahoo IM, or Windows Messenger so that I can attempt to explain what my employer wants? Afterwards, I'd be more than happy to post a summary.

USEN
 
Don't know if you noticed, but I posted again with the sample right before you did (post 45).

Sorry, I don't use any of the IM services. My boss and my wife are the only ones with instant access to me. :p

If you want to email it to me or something, that's fine.
 
Email wouldn't help as I'd still be writing a small manuscript just trying to explain what my employer wants. I'd be glad to give you my cell phone # (only phone I have), but wouldn't want to post it here. I can email it to you if you'd like, but I'd need an email address. If you don't have free unlimited long-distance, I'd be happy to call you...if you're willing to email me your number.

USEN@msn.com (not my main email. This one is my online Hotmail account which I only view when I'm expecting mail...so I don't mind posting it...lol)
 
Oh...if you're going to use the Hotmail address, let me know so that I can go view the message...lol.

USEN
 
Paul...I'm just about to start incorporating the changes you made into my original database. I'll let you know if they work as again...just like last time, they don't work in the copy I received from you. Perhaps it has something to do with the fact that the copy I get back from you is read-only? It won't even allow me to save it with a different name. How do you set that? Since I do a lot of work online (mainly in Excel and Word) for people I don't know. If it would work on those programs as well, it would definitely be a fantastic tool to allow them to see the work I've done but not be able to save it until they've settled their account. I know how to change the attributes of a file to make it read-only; however, that doesn't prevent them from saving it with a different name & then using it.

You didn't say, but as far as I can tell you made changes to both the Main table and the Languages table. Now I just need to figure out the exact changes you made & what you did to make them. I know some of it was in the coding, but not sure where. I'll have to search through it all to find out what's different.

Thanks again for your continuing assistance,
USEN

Oh...since you don't have Skype or any othe IM, when I get to that part where I was hoping to speak to you, I'll just have to write that mini novel...lol.
 
Hi again, Paul,

It took a little tweaking...mostly on my part, but I got it working exactly the way I expected it to work. Thanks so much for your assistance. Now I'll start on the other similiar tables.

Meanwhile, for the sake of others who might benefit...here's the latest update. :D

USEN
 

Attachments

Hi Everyone...H-E-L-P!

What am I doing wrong? On my main form, I decided to change the text box for "Country" to a combo box bound to a table named tbl_Countries. The SQL includes both fields: Country_ID (auto#) and Countries (text). When I click the arrow, the list appears just like it is supposed to; however, when I attempt to select one of the items, it's just beeps at me and won't allow a selection. What have I forgotten? Since this is a combo box I shouldn't need any code to make a selection, do I? I'm sure I need some code for the AfterUpdate event to clear the selection when I advance to another form, but I can't get that far.
 
Never mind everyone...I finally found the problem....

USEN
 
I love it when problems are solved while I sleep!

I don't do anything to secure the db; they should work for you as they work for me. Are you sure you're unzipping the folder first, then running the mdb? If you just double click on the zipped folder and then the file, I think it will be read-only.
 
Hi Paul,

I don't know of any other way to unzip a file other than to double click on the zipped folder and then on the file. Heck...I thought I'd finally discovered a way to secure my work until it had been paid. So far I've been lucky & haven't needed it, but there may come a day....

B.T.W...What is the proper procedure for unzipping? Being read only hasn't mattered any since I usually continue working while awaiting your reply; therefore, I have to append anything you've done to my current work anyway, but it would be nice to know especially since these zip files serve as nice backups...lol.
 
Presuming a recent version of Windows, right-click on the zipped file and choose Extract All, then follow the wizard.
 
I have Windows XP. Don't have any zipped files at the moment to try it out on, but I'm sure I'll be receiving more from you soon...just give me a couple hours...LOL!
 
Paul...what am I doing wrong here? I've set up my sfrm_Freelancer's_Prof_Categories exactly like the sfrm_Freelancer's_Languages and duplicated the code except for changing the name where applicable. Everything seemed to be working fine until I noticed that when I press the delete buttons, it deletes the item from the main tbl_Professional_Categories table instead of the junction tbl_Freelancer's_Prof_Categories table. Even thoughn I've checked & recheck it, since I don't understand all the coding for the delete key perhaps I've entered something wrong? Here's the db again for you to check.

USEN :confused:
 

Attachments

Hi Everyone...It took me forever, but I finally figured out what was wrong. NOTE: I said "what"...not "why". When I first joined this thread...(that has now become a mini novel...lol), it was because I'd read in more than one place that in order to use MultiSelect, the listbox could NOT be bound to a table, but must use a query. Therefore, I had several mistakes: (1) I had forgotten to go in and establish my Relationships between the two main tables with the junciton table in between them thus a many-to-one-to-one-to-many. (2) Because of the above information, I had used a query as my source...thus, without the Relationship established, when I tried to delete an item, it was somehow going back & deleting the entry in the main table. Once I established the Relationship with referential integrity, I kept getting the error telling me that I couldn't delete it because of integrity...which told me for certain that I had the command button posting the data to the wrong table...but I can't figure out exactly why since the SQL is based on a query that just isn't saved as a regular query? In fact, if I recall correctly, the way I originally got the query I was using was when the Access asked me if I wanted to save the SQL as a query...which I did and gave it a name. When I did that, it automatically lists the query name as the source rather than the long function involving tables.

Of course, while most people would be happy just to say it's working...that's NOT me. I need to understand WHY it did what it did in order for me to remember. I remember by understanding...not by memorizing...or perhaps I should say, it's difficult for me to memorize when I don't understand. Either way...can someone please explain to me what happened here?

Thanks! I'm ready to start on similiar form #3...

USEN
 
Hi Paul or Bob...R U around this afternoon? I'm ready to tackle the complicated portion of this project & would love your advice on how I should do it. If you're ready to wrack your brain, please read the attached Word file. It was much easier to write it there than directly on here.

Once again, I greatly appreciate the input & assistance you're giving me.

USEN :eek:
 

Attachments

Users who are viewing this thread

Back
Top Bottom