Copy Number value from Previous record...

N

Navatin

I am new to Access programming and I am having some problems.

I have a list form that is called from a master form. When this form
opens, it
loads all data that matches with the primary key field of the form it was
initiated
from.

The data entry of the list form allows for entry of several required fields
from a
table although the source of data is from a query as I am displaying lookup
information also.

My question is, for the second field on the list form, which is the matching
field
of the primary key from the master form that opened the list form, how can I
have this field default to the value of the primary key field from the
master form?

I appreciate any help that can be provided.

Thanks - Navatin...
 
S

Seth Schwarm

Navatin:

Utilize the OnCurrent event of the list style form as follows -

If IsNull(Me!ForeignKey) And Me.NewRecord = True Then
Me!ForeignKey = Forms!MainForm!PrimaryKey
End If

Replace these objects with the real names - ForeignKey, MainForm, PrimaryKey

Seth Schwarm
 
N

Navatin

Seth,

Thank you very much for your input. This worked very well.

Have a great day.

Navatin...
 

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