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 VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 February 26th, 2008, 06:02 PM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default check box help?

this should be very simple for the experts but since i'm a novice at this even the easy stuff throws me for a loop.

i have a check box on my form to carry over the customers address to the billing address if its the same. if left unchecked then the user needs to fill in a different billing address but if the user checks the box i need the text boxes to fill in the customers address. whats the best way to set this up?

do i write a procedure for each text box using the "BeforeUpdate"?
does anyone have a simple code to do this?

Reply With Quote
  #2 (permalink)  
Old February 27th, 2008, 09:47 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You would use the Before Update and Before Insert events of the data entry form. Then check for a value in the check box, and if it = -1, then do this:

Me.Address1 = Me.BillingAddress1
Me.Address2 = Me.BillingAddress2
Me.City = Me.BillingCity
etc.

Did that help?

mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #3 (permalink)  
Old February 27th, 2008, 09:54 AM
Authorized User
 
Join Date: May 2007
Location: , , .
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Following on from mmdonal's post which I agree is the simplest solution to the issue you have. Have you considered the situation where you have to change the billing address and take the tick out?

A simple question messagebox checking the user's intentions would address the issue. With an IF statement testing the answer it afterwards would allow for this option.

A bit more work, however it will allow more flexibility in your application and counteract inputting errors further down the line.

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
Check BOx kaushikpulpa ASP.NET 2.0 Professional 2 August 30th, 2007 08:01 AM
VBA - Check box KennethMungwira Access VBA 2 May 22nd, 2006 10:43 AM
please help (get check box value) qadeerahmad General .NET 3 September 24th, 2004 08:46 AM
Check box Error surendran BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 July 25th, 2004 11:36 PM
how to get value from check box..... cici Classic ASP Professional 2 May 15th, 2004 08:35 AM



All times are GMT -4. The time now is 06:05 AM.


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