Subform Default Value

  • Thread starter jasonsmith via AccessMonster.com
  • Start date
J

jasonsmith via AccessMonster.com

I have a main form with a few different subforms. I'm trying to update the
data from one subform to the other. When the main form opens only one
subform appears "Form_fm14BinghamCAP_SealShaftAF". Once I have entered data
into the field(s) "lngShaftODAF" I want the user to be able to click a button
on the main form which then hides the current subform
"Form_fm14BinghamCAP_SealShaftAF". It then displays the hidden subform
"Form_fm14BinghamCAP_BrgAL" with all of it's fields. One of the fields is
"lngShaftODAL". The code runs but the field "lngShaftODAL" displays a 0
instead of the field answer from "lngShaftODAF" .


Form_fm14BinghamCAP_BrgAL.lngShaftODAL.DefaultValue =
Form_fm14BinghamCAP_SealShaftAF.lngShaftODAF

I put in a stop point in the code to see if the code has the correct answer
and it does but this answer is not popullated to the form field.

any idea's
thanks
 
S

strive4peace

Hi Jason,

use the form BeforeInsert event of Form_fm14BinghamCAP_BrgAL

me.lngShaftODAL =
nz(me.parent.Form_fm14BinghamCAP_SealShaftAF.form.lngShaftODAL,0)

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
J

jasonsmith via AccessMonster.com

Thanks for your help I used the code you provided and in the end it worked.
My real problem though was a format issue on the field i was trying to
default to. Once i fixed it your code and the code i was trying both worked.
Thanks again for your help Crystal
Hi Jason,

use the form BeforeInsert event of Form_fm14BinghamCAP_BrgAL

me.lngShaftODAL =
nz(me.parent.Form_fm14BinghamCAP_SealShaftAF.form.lngShaftODAL,0)

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
I have a main form with a few different subforms. I'm trying to update the
data from one subform to the other. When the main form opens only one
[quoted text clipped - 14 lines]
any idea's
thanks
 
S

strive4peace

you're welcome, Jason ;) happy to help

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Thanks for your help I used the code you provided and in the end it worked.
My real problem though was a format issue on the field i was trying to
default to. Once i fixed it your code and the code i was trying both worked.
Thanks again for your help Crystal
Hi Jason,

use the form BeforeInsert event of Form_fm14BinghamCAP_BrgAL

me.lngShaftODAL =
nz(me.parent.Form_fm14BinghamCAP_SealShaftAF.form.lngShaftODAL,0)

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

I have a main form with a few different subforms. I'm trying to update the
data from one subform to the other. When the main form opens only one

[quoted text clipped - 14 lines]
any idea's
thanks
 
Top