Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 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
Default 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

Reply With Quote
  #2 (permalink)  
Old 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
Default

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
Reply With Quote
  #3 (permalink)  
Old 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
Default

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


Reply With Quote
  #4 (permalink)  
Old 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
Default

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
Reply With Quote
  #5 (permalink)  
Old 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
Default

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
Reply With Quote
  #6 (permalink)  
Old 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
Default

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


Reply With Quote
  #7 (permalink)  
Old 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
Default

casrhinos,
Great! Look forward to your success!

dartcoach
Reply With Quote
  #8 (permalink)  
Old June 27th, 2008, 07:06 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofilling a column Hudson40 Excel VBA 1 January 4th, 2005 07:30 AM



All times are GMT -4. The time now is 07:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.