defaulting subform values to mainform's prior records

C

Cheryl

I have a mainform called production machine and then a subform that lists the
employees. I would like to have the subform values default to the same names
that I listed in the prior mainform record. Is there a way that I can make
it do this?
 
B

bhicks11 via AccessMonster.com

Hi Cheryl

Here's a good solution from Dev Ashish:

Forms: Carry current value of a control to new records
Author(s)
Dev Ashish


(A) To use the curent control value for new records, you need to assign it
to the defaultvalue of the control. For example something like

'******** Code Start **********
const cQuote="""" 'Thats two quotes
me!Control.DefaultValue = cQuote & me!Control.Value & cQuote
'******** Code End **********

would carry the current value of the control forward if you place this
code behind a command button to conditionally run it.

Bonnie
http://www.dataplus-svc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top