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

Setting Default Value

P: 3
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
Share this Question
Share on Google+
3 Replies


P: 3
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

P: 3
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
Expert Mod 15k+
P: 31,660
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

Post your reply

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