Go Back   Access World Forums > Microsoft Access Discussion > Macros

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-04-2017, 12:41 PM   #1
Tony_Walker
Newly Registered User
 
Join Date: Sep 2017
Posts: 6
Thanks: 10
Thanked 0 Times in 0 Posts
Tony_Walker is on a distinguished road
Add selected records from a form to a table

Dear Access experts!
In my database, i ve created a form to add exams. As you can see to forms,i added on form caled select (it is a multivalue field from edapy_exams)
- What i want to achieve is to add a button so selected exams from ths form, append to table Patient_order_exams, linked with patient_order_id. This way user has a litle chance to add the same exam twice.
- I wonder if there is a way to prevent user to add the same exam twice to patient_order_exams (per record)
I think this will help and other users to append records, and make db look nice and ... tidy
Thank you
Attached Files
File Type: zip TestLab.zip (444.2 KB, 25 views)


Last edited by Tony_Walker; 10-04-2017 at 12:55 PM.
Tony_Walker is offline   Reply With Quote
Old 10-04-2017, 02:31 PM   #2
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 9,597
Thanks: 37
Thanked 3,105 Times in 3,016 Posts
CJ_London is a jewel in the rough CJ_London is a jewel in the rough CJ_London is a jewel in the rough
Re: Add selected records from a form to a table

cross posted here with answers
http://www.accessforums.net/showthread.php?t=68371
@Tony - please read this link about the etiquette of cross posting
http://www.excelguru.ca/content.php?184
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
Tony_Walker (10-04-2017)
Old 10-04-2017, 02:47 PM   #3
moke123
Newly Registered User
 
Join Date: Jan 2013
Location: Massachusetts
Posts: 453
Thanks: 0
Thanked 137 Times in 130 Posts
moke123 is on a distinguished road
Re: Add selected records from a form to a table

Quote:
I wonder if there is a way to prevent user to add the same exam twice to patient_order_exams (per record)
Heres one example on how to exclude an item from the list if its already been selected.
Attached Files
File Type: zip Ex_testLab.zip (29.1 KB, 24 views)

moke123 is offline   Reply With Quote
The Following User Says Thank You to moke123 For This Useful Post:
Tony_Walker (10-04-2017)
Old 10-04-2017, 03:05 PM   #4
Tony_Walker
Newly Registered User
 
Join Date: Sep 2017
Posts: 6
Thanks: 10
Thanked 0 Times in 0 Posts
Tony_Walker is on a distinguished road
Re: Add selected records from a form to a table

Quote:
Originally Posted by moke123 View Post
Heres one example on how to exclude an item from the list if its already been selected.
I think this is a very good solution. I will test it! If it works, i will uplaod the db working so other users can see it work. In my db must be linked to order and not to patient.

Last edited by Tony_Walker; 10-04-2017 at 03:12 PM.
Tony_Walker is offline   Reply With Quote
Old 10-04-2017, 03:07 PM   #5
Tony_Walker
Newly Registered User
 
Join Date: Sep 2017
Posts: 6
Thanks: 10
Thanked 0 Times in 0 Posts
Tony_Walker is on a distinguished road
Re: Add selected records from a form to a table

Thank CJ_Lodnon. My mistake!!!! Really sorry!
I mention it to my post to other forum, with moke123 solution.

Last edited by Tony_Walker; 10-04-2017 at 03:41 PM.
Tony_Walker is offline   Reply With Quote
Old 10-05-2017, 12:35 PM   #6
Tony_Walker
Newly Registered User
 
Join Date: Sep 2017
Posts: 6
Thanks: 10
Thanked 0 Times in 0 Posts
Tony_Walker is on a distinguished road
Re: Add selected records from a form to a table

Quote:
Originally Posted by moke123 View Post
Heres one example on how to exclude an item from the list if its already been selected.
Moke123 i ve tried a lot but ... i couldnt much it to my db... my knolege is limmited... Thank you anyway, i really think this is the way. The only thing that needs to be changed is to take the order id.. from somewhere and not from a dropadown list, so the selected exams will be the records of Patient order exams. Like the link you have posted, i ve changed the patient with Patient_order to match with my db and the other table was edapy_Exams, the join table for me is Patient_order_exams. ... and then i lost it!!!
I really need somebodys help with this part.. if you like.
Because i dont know how to handle macros, i cept the names you gave. When you try to add without an id sows message,which is correct. What i couldnt do is to change combo2 so it could be linked with the open patient order (patientid for your example)
You can see the relationships and understand what i mean.
Anyway thank you very much for the idea, you are great!!
Attached Files
File Type: zip Ex_testLab2.zip (434.2 KB, 16 views)


Last edited by Tony_Walker; 10-06-2017 at 02:06 PM.
Tony_Walker is offline   Reply With Quote
Reply

Tags
form access , form button , ms-access sql , ms-access-2010

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop through selected records on a form raystownlaura Modules & VBA 5 07-26-2015 01:44 AM
[SOLVED] VBA help needed to update table based on list box multi selected records krjoshi Modules & VBA 2 11-24-2014 10:51 PM
Delete selected records from a table branston Modules & VBA 2 09-07-2009 02:21 AM
Print Selected Records from Form Robert M Reports 4 06-25-2009 06:58 AM
Viewing Selected Records in a Form CassandraB Forms 1 03-02-2003 02:25 PM




All times are GMT -8. The time now is 12:30 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World