473,489 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Setting Default Value

3 New Member
I am having (I believe) a similar issue (See Default Value).
I have a form frmShippingRequestForm with a subform sfrmPackageDetails. My main form has a chkPersonalShipment, txtProjectNo, txtPersonalProjectNo, and txtContentDescription. If the chkPersonalShipment box is checked, then txtProjectNo is autofilled and disabled so the user can't change it. They must enter a personal project number. txtContentDescription is then automatically filled with "Bill to <PersonalProjectNo>" (where <PersonalProjectNo> is whatever value they enter in the txtPersonalProjectNo field). If the chkPersonalShipment box is unchecked, then the txtPersonalProjectNo field is disabled, and they must enter a department project number in txtProjectNo.

My subform is a datasheet, and can contain details for multiple packages in a single shipment. It has a Reference2 field. I need to set the default value to the value of txtContentDescription on the main form if the user checked the chkPersonalShipment box.

I've tried setting the default value with Me.sfrmPackageDetails.Form!Reference2.DefaultValue = Me.txtContentDescription (and several other variations), but it just displays "#Name?" in the field.

Any suggestions?
Dec 19 '07 #1
3 1337
JAGlick
3 New Member
Oh, and I also tried setting the the default value directly on the table behind the subform, but that doesn't work since I can't have the form open when I edit the table, and I can't save the table with the main form closed if I reference a field on the form.
Dec 19 '07 #2
JAGlick
3 New Member
I think I found a way around it... Probably better what I was originally thinking. I set the default value on the Reference2 field on the subform to the value of the txtContentDescription on the main form. When the user makes the selection on the main form, I requery the subform. If someone knows of a better way, great. Otherwise, I think this will accomplish what I need.
Dec 19 '07 #3
NeoPa
32,556 Recognized Expert Moderator MVP
JAGlick,
I'm afraid you can't take-over another thread for your question. This is thread hijacking and is not allowed.
I expect it was a simple oversight so I will split this into it's own thread with links connecting the two.

ADMIN.
Dec 20 '07 #4

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

Similar topics

6
1725
by: the.theorist | last post by:
I have a small, simple class which contains a dictionary (and some other stuff, not shown). I then have a container class (Big) that holds some instances of the simple class. When I try to edit the...
10
2716
by: MLH | last post by:
I have an A97 table with a Yes/No field named TowJob and a form bound to that table. The TowJob control on the form is bound to the same field. It is an option group with Yes and No bttns valued...
18
18293
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
3
6710
by: Marty McFly | last post by:
Hello, I have a control class that inherits from System.Web.UI.WebControls.Button. When I drag this control from the "My User Controls" tab in the toolbox onto the form, I want it to reflect the...
3
3336
by: Barbara Lindsey | last post by:
I have a case where I am collecting a "Start Date" and an "End Date". I would like to default the "End Date" to the "Start Date" value if only the "Start Date" is entered. I tried setting this as...
1
6434
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
10
2491
by: Brad Baker | last post by:
I have an asp.net/csharp application that requires a particular variable to work properly. This variable is usually passed via a query string in the URL when the application is first run but under...
8
16083
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list...
7
1719
by: PetterL | last post by:
I have a setting called My.settings.firstrun set to True, set in the setting manager. When i read this in the first form form_Load in a IF sentence it always come out as false. I have tried to...
1
5212
by: RobertTheProgrammer | last post by:
Hi all, I have a perplexing problem here. I've developed some software using ASP.NET with C# in the code behind. I've been setting the "window.defaultStatus" in the code behind to send messages...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4875
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.