Default values in subforms

  • Thread starter Thread starter James
  • Start date Start date
J

James

I have a subform with the fieds <Document Id> and <Format>

The document id is the primary key and the format can be
is A1, A2, A3 etc... each document has an original format
size recorded in the 'document' form. In the subform I
would liek the format field to show a default value based
on the original document format. So if i select a
document which is has an original sixe of A1 then th
eformat field default value will show A1, but as someone
may be issuing a document with an original size of A1 in
A2 format then this is why I need a separate format field
from the original field.

Hope that makes some kind of sense. James
 
To get the "Format" field to default to the same as the "Format" field on
the parent form, use the subform's BeforeInsert event procedure:

Private Sub Form_BeforeInsert(Cancel As Integer)
With Me.Parent!Format
If Not IsNull(.Value) Then
Me!Format = .Value
End If
End With
End Sub
 
Back
Top