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 February 26th, 2008, 06:02 PM
Authorized User
 
Join Date: Jan 2006
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?

 
Old February 27th, 2008, 09:47 AM
Friend of Wrox
 
Join Date: Mar 2004
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
 
Old February 27th, 2008, 09:54 AM
Authorized User
 
Join Date: May 2007
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.






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





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