Default values in subforms



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

Allen Browne

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

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