Show record in main form by selecting it in subform

G

Guest

Hello there,

I have a form and a sub-form generated out of the same table; the difference
is that the main form (columnar format) shows (one at a time) all the records
from the table with date=today. The sub-form (datasheet format) shows all the
records from that table with date=today AND with one of the fields = null.
The idea is that as records without that field filled out are entered in the
main form they are all shown up in the subform. I would like to be able to
select one of those records from the subform by clicking in it and that that
would load that record in the main form (to fill out that field that was
empty until that point). Any ideas?

Thanks for your help!
 
M

Marshall Barton

Alejandro said:
I have a form and a sub-form generated out of the same table; the difference
is that the main form (columnar format) shows (one at a time) all the records
from the table with date=today. The sub-form (datasheet format) shows all the
records from that table with date=today AND with one of the fields = null.
The idea is that as records without that field filled out are entered in the
main form they are all shown up in the subform. I would like to be able to
select one of those records from the subform by clicking in it and that that
would load that record in the main form (to fill out that field that was
empty until that point).


I suggest that you use the subform's Form DoubleClick event
(triggered when you double click the record selector) with
just this one line of code:

Parent.Recordset.FindFirst "[keyfield]=" & Me.keyfield

where keyfield is the table's primary key field.
 

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