Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 17th, 2008, 10:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

I understand your table structure. Just remember, if anyone has more than one specialty, you will need the second table to make a one-to-may relationship between physician and specialties. You should not put a repeating group in your one table, e.g. Physician, Specialty1, Specialty2, etc.

If the form's source object is the actual table itself (or an updateable query based on that table), then you don't need the RunSQL statment. Simply typing the specialty into the combobox will place that specialty into the physician's record for that field.

If the form is unbound, try using ADO and creating a recordset object to populate the information.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old June 17th, 2008, 10:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

OK, I understand your table structure now. Just remember, if anyone has more than one specialty, you will need the second table to make a one-to-may relationship between physician and specialties. You should not put a repeating group in your one table, e.g. Physician, Specialty1, Specialty2, etc.

If the form's source object is the actual table itself (or an updateable query based on that table), then you don't need the RunSQL statment. Simply typing the specialty into the combobox will place that specialty into the physician's record for that field.

If the form is unbound, try using ADO and creating a recordset object to populate the information.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old June 18th, 2008, 06:21 AM
Authorized User
 
Join Date: Sep 2006
Posts: 73
Thanks: 6
Thanked 0 Times in 0 Posts
Default

SerranoG:

Thank you. I will mess with it this morning. I don't have a physician with multiple specialties. Each one only has one.

The source object on the form is not that table. It would be easy that way. I am just trying to update the 'Physician' table when a physician specialty is entered into the 'Specialty' combo box. I cannot get it to work. I have it working to 'Insert' both a new physician and specialty to the table when a new physician is typed in the 'Physician' combo box and a specialty is typed in the 'Specialty' combo box, but that is all.

I am just trying to select a physician in the 'Physician' combo box and after it is selected, if a specialty is not displayed in the 'Specialty' combo box, type it in, press 'Save' and the specialty is added to the 'Physician' table corresponding to the physician selected.

Thanks again for all of your help.
Tony






Similar Threads
Thread Thread Starter Forum Replies Last Post
SOLVED...VBA and Update Query eusanpe Access VBA 8 June 2nd, 2008 08:48 AM
vba recodeset update (Excel) stepdev VB Components 1 October 20th, 2006 09:17 AM
I solved insert query.now see this Update Query. [email protected] VB.NET 2002/2003 Basics 2 September 21st, 2006 12:48 AM
using VBA to implement cascade update~~~HELP bbqlee Access 2 August 7th, 2006 02:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.