New record line in subform to repeat field from previous line

JeffreyDavid

Registered User.
Local time
Today, 22:23
Joined
Dec 23, 2003
Messages
63
I have a form and subform and when the form opens, the subform copies the project number from the form. But when there is a second line in the subform, it doesn't repeat the project number. I have put the [Form]![MainForm]![ProjectNo] as the default value, and that didn't work. I also put into the Before Insert event, and that didn't work.
Are there any other ways to get a field to repeat on a subform?
 
Are you sure the field did not fill? Try requerying the text box in the subform after you store the value... it may be stored, just not appearing on the screen.

Code:
Me.MySubformTextBox = Forms!MainForm!ProjectNo
Me.MySubformTextBox.Requery

I can't make any assumptions about the format of your DB but ideally, the project number from the main form should be the primary key in the form's underlying table and should be linked to the subform's table. If the 2 forms are properly set up, the project number will automatically copy into the subform's table and will always be a common link between the 2 forms & tables.
 

Users who are viewing this thread

Back
Top Bottom