By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,654 Members | 1,840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,654 IT Pros & Developers. It's quick & easy.

Switching values between tab pages.

P: 111
I have a bound form which has tab control with 10 pages. I want to switch date values between page 1 and page 3.
For example on Page 1 there is a textbox called Start Date and End Date
On Page 3 there is a textbox called Final Start Date and Final End Date.
On Page 1 Start Date txtbox is locked and should automatically populate value which will be entered on Page 3's Final Start Date.
I tried to set the default value of Start date but it says "#Name".
Expand|Select|Wrap|Line Numbers
  1. Default value=[Forms]![Main Data Entry]![ExtensionFinalStartDate].[Text]
Apr 7 '10 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 2.5K+
P: 2,545
Hi AccessBeetle. Two problems: the Text property is only available when the textbox concerned has focus, and the default value property is not being correctly set or referred to.

If you are using VBA to set the default value property you should be able to refer to controls that are on your current form's tabbed pages using the Me shortcut to replace the full reference to forms!formname!controlname.

The VBA form of setting the default is:

Expand|Select|Wrap|Line Numbers
  1. Me.YourStartDate.DefaultValue="'" & Me.ExtensionFinalStartDate & "'"
Note that the default value is a text property - hence the single quotes on either side.

If you are not using VBA but just want to refer directly to the other control in the Start Date's Default Value property in design view, you would just set the default value property for the control concerned to:

Expand|Select|Wrap|Line Numbers
  1. =[Forms]![Main Data Entry]![ExtensionFinalStartDate]
The use of the .Text property would explain the error message you got.

Apr 7 '10 #2

P: 111
thanks for reply
I am using second option.
I tried to put something like this but now it says "#Error" in tha tbox
Expand|Select|Wrap|Line Numbers
  1. =[Forms]![Main Data Entry]![ExtensionFinalStartDate].[Text]
Apr 8 '10 #3

P: 109
Remove the .[Text] bit on the end. Stewart did explain that is why you were getting the error message
Apr 8 '10 #4

P: 111
Expand|Select|Wrap|Line Numbers
  1. =[Forms]![Main Data Entry]![ExtensionFinalStartDate]
My bad!!
Got it worked
Apr 8 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.