Need to make form field default to the value of the preceding field.

BruceWaller

New Member
Joined
Jul 12, 2011
Messages
9
How do I make my "ship to" address default to the value filled in on the previous field "bill to" address on my Access 2010 form. Thanks for your help. I've been googling for 20 minutes and striking out. Promised this database would be done tomorrow morning so I need to add as many user-friendly shortcuts, bells, and whistles as possible because I still have a ton of work to do on queries and reports. Thanks for your help.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Assuming the field names are BillTo and ShipTo, put this code in the AfterUpdate event of BillTo:

Code:
Me.ShipTo = Me.BillTo

If you haven't built event code before, do this:
Double-click the blank row next to the After Update event (Properties, Event tab)
You should see [Event Procedure]. Now click on the ... button at the end of the line and you will be taken to the code window.
The blank line before End Sub is where the code goes.

Note: This is the method if both controls are text boxes. If one or morw of them is a combo box, you will need a slightly different approach. Let me know if that is the case, and what types of controls you are using.

Denis
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,719
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top