|
 |
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

June 11th, 2008, 02:37 PM
|
Registered User
|
|
Join Date: Jun 2008
Location: Leeds, , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Autofilling or not
Access 2003
I have a table with staff personal details including address fields and a telephone number field.
I have another table with Emergency Contact details (i.e. if we need to contact the staff members family in cases of accident etc)
I want to have a tick box on the second form which is labeled "is the emergency contact telephone number the same as the staff member" which if ticked will populate the Emergency contact's telephone number with the same number that is on the first form. If it's not ticked the user can input a different number
Similarly, with the address fields.
Any ideas? Many thanks in advance
|

June 11th, 2008, 03:48 PM
|
Friend of Wrox
|
|
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
casrhinos,
How are the two tables related? By an employee id? When a user navigates from the first form (staff details) to the second form(Emergency Contact details), how are you populating the second form now?
dartcoach
|

June 11th, 2008, 04:02 PM
|
Registered User
|
|
Join Date: Jun 2008
Location: Leeds, , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
Yes, forms are related by field HRID - The user clicks on a command button on Personal Details form which opens the Emergency Contact form filtered by HRID - at present the Personal Details form closes to keep the screen "tidy" but that's not essential if it makes a work-around easier.
At present the user has to input all the address and telephone details on the Emergency Contact Form regardless of whether they are the same or not.
Hope that explains
Cheers
|

June 11th, 2008, 04:07 PM
|
Friend of Wrox
|
|
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
casrhinos,
Before you close the Personal Details form (in the code behind the command button), use a msgbox and ask if they want to use the details. If they say yes, then populate the fields on the Emergency contact form from the values on the personal details form - then close the personal details form.
Make sense?
dartcoach
|

June 11th, 2008, 04:48 PM
|
Friend of Wrox
|
|
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
casrhinos,
There are many other ways to accomplish this. This way is quick, without too much code.
Other ways would require more code, but would probably be more efficient.
HTH,
dartcoach
|

June 12th, 2008, 01:37 AM
|
Registered User
|
|
Join Date: Jun 2008
Location: Leeds, , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
HI Dartcoach
Sorry for delay, tiredness won!
I'd prefer the extra code (efficient) way but will give your initial way a try first today.
Many thanks - will respond later with success/failure !! :-)
Cheers
|

June 12th, 2008, 09:19 AM
|
Friend of Wrox
|
|
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
casrhinos,
Great! Look forward to your success!
dartcoach
|

June 27th, 2008, 07:06 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Something to think about as far as dB bloating.
If the emergency contact phone number and/or address is the SAME as the employee, why then store that data AGAIN in the other table? You're bloating the database.
Why not just let them click the checkbox and the user knows to call the employee's home? Populate the other table ONLY if the values are different. If the user doesn't click the checkbox, then require him/her to enter the extra info to make sure it gets entered.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
Autofilling a column |
Hudson40 |
Excel VBA |
1 |
January 4th, 2005 07:30 AM |
|
 |