Go Back   DeveloperBarn Forums > Databases > Microsoft Access

Sponsored Links

Discuss "Chooser Form" in the Microsoft Access forum.

Microsoft Access - Microsoft Access is a database for small to medium applications. Learn tips and tricks and best database practices here.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old August 1st, 2008, 01:58 AM
sbenj69's Avatar
Moderator

 
Join Date: Mar 2008
Posts: 84
Thanks: 20
Thanked 24 Times in 19 Posts
Rep Power: 1
sbenj69 is on a distinguished road

Awards Showcase
Microsoft Windows Microsoft Access 
Total Awards: 2

Default Chooser Form

Well, we've all seen it. You see it all the time when you are choosing fields in a wizard. You have a box on the left showing what you can choose, and a box on the right showing what you chose. You can toggle your choices back and forth from being chosen or not.

I know what you're thinking, "Can I do this in a database?" The answer is "Yes". The key is to set it all up properly. Some things to know first:

1. You need a general knowledge of vba, as this will entail using "Insert" and "Delete" SQL from VBA.

2. You have to have a good knowledge of how to set up queries to show what has and has not been chosen. Yes, this sounds simple, and on the chosen part it is; on the what's left to be chosen, well, we'll just say it takes a little bit of magic (in other words a dcount() function)

In this example I have 3 tables:
tblEmployees
tblEmployeeSkills
tblSkills

tblSkills will just be used as a lookup table for available skills.

First of all, you need to setup you queries to limit to chosen and unchosen.

Secondly, start a form based on tblEmployees. Make 2 listboxes based on the chosen and unchosen queries.

Next, make 2 command buttons that will use vba to insert and delete. The left side (Unchosen skills) will use the insert, and the right side (Chosen skills) will use the delete. In my example, I also gave the choice of double clicking to insert or delete.

Lastly, I made a subform based on the chosen skills. With every update, both listboxes will need to be requeried.

I didn't go into great detail; that's up to you to look at the queries and the vba. This is just an example of how to make a chooser form to update your tables.

The download is now in the next post with updates being added.

Last edited by sbenj69; August 1st, 2008 at 05:01 PM.
Reply With Quote
The Following User Says Thank You to sbenj69 For This Useful Post:
AOG123 (August 1st, 2008)
Sponsored Links
  #2  
Old August 1st, 2008, 04:02 PM
sbenj69's Avatar
Moderator

 
Join Date: Mar 2008
Posts: 84
Thanks: 20
Thanked 24 Times in 19 Posts
Rep Power: 1
sbenj69 is on a distinguished road

Awards Showcase
Microsoft Windows Microsoft Access 
Total Awards: 2

Default

Ok, changes made. Added record navigation error checking; fixed grouping for skills not chosen.

Here is the updated DB.

Edit: Thanks AOG for your help
Attached Files
File Type: zip chooser.zip (39.9 KB, 23 views)
Reply With Quote
  #3  
Old August 2nd, 2008, 11:47 PM
don94403's Avatar
Moderator


 
Join Date: Mar 2008
Location: San Mateo, CA, USA
Posts: 63
Thanks: 3
Thanked 8 Times in 8 Posts
Blog Entries: 2
Rep Power: 1
don94403 is on a distinguished road

Awards Showcase
PHP Microsoft Access 
Total Awards: 2

Default

VERY nice, benji. I included a sort of chooser (I didn't think to call it that) in the demo database that I just posted here, but you've carried it through to assigning the skills to the employees, which is a step further than I took it. Nice work!
Reply With Quote
  #4  
Old August 12th, 2008, 07:30 AM
Barn Regular

 
Join Date: Jul 2008
Location: Philadelphia, PA
Posts: 76
Thanks: 8
Thanked 0 Times in 0 Posts
Rep Power: 1
nboscaino is an unknown quantity at this point
Default

I down loaded the chooser thing and it seems really cool so thanks but when I tried to use it I got an error msg. I personally am not really ready yet for something like that nor do I think I have enough knowledge of how to impliment it in a DB. Like I said though it seems to have a bug. Thank you though for it. It seems great.
Reply With Quote
  #5  
Old August 12th, 2008, 07:31 AM
AOG123's Avatar
Lightning Master

 
Join Date: Mar 2008
Location: Fortress Of Solitude
Posts: 93
Thanks: 6
Thanked 23 Times in 18 Posts
Rep Power: 1
AOG123 is on a distinguished road

Awards Showcase
Microsoft Access 
Total Awards: 1

Default

Have you extracted it from the zip file?
__________________
If i helped you, make me famous by clicking the
Reply With Quote
  #6  
Old August 12th, 2008, 09:41 AM
sbenj69's Avatar
Moderator

 
Join Date: Mar 2008
Posts: 84
Thanks: 20
Thanked 24 Times in 19 Posts
Rep Power: 1
sbenj69 is on a distinguished road

Awards Showcase
Microsoft Windows Microsoft Access 
Total Awards: 2

Default

Yeah, if you run any database from the zip, you will get errors because it cannot update the database. Make sure you extract the file and run the extracted file.
Reply With Quote
  #7  
Old August 14th, 2008, 08:53 AM
Barn Regular

 
Join Date: Jul 2008
Location: Philadelphia, PA
Posts: 76
Thanks: 8
Thanked 0 Times in 0 Posts
Rep Power: 1
nboscaino is an unknown quantity at this point
Default

Oh Ok Ill try that but like I said cool stuff cant wait to see it work and more than that cant wait to be able to know how to do it in my stuff
Reply With Quote
Reply

  DeveloperBarn Forums > Databases > Microsoft Access

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Email] Simple way to email form Rebelle ASP Development 17 August 14th, 2008 04:03 PM
Generic Form Handler richyrich .Net Development 3 July 28th, 2008 01:34 PM
filters on a form javier_83 Microsoft Access 4 July 28th, 2008 01:03 PM
Time Entry Form sbenj69 Microsoft Access 2 July 14th, 2008 02:11 PM


All times are GMT -4. The time now is 01:50 PM.



Content Relevant URLs by vBSEO 3.2.0