Select record to display in form

D

Dave

I have a form that displays a record. But I'm working out a good way
to choose what record will be displayed. On this form is a button
which opens another form which will filter on several text boxes and
give me all matching records in a continuous form.
I would like to select one of those records and have it displayed in
the original form.

How do I do this???

Thanks,

Dave B
 
D

Dave

Both your "AnotherForm" and "OriginalForm" must have the primary key of the
records and both should have the Visible property of the field set to No.
Put the following code in the Click event of the button on the original
form:
DoCmd.OpenForm "AnotherForm",,,,acDialog
Me!RecordsetClone.FindFirst "[PKField] = " & Forms!AnotherForm!PKField
DoCmd.Close "AnotherForm"

Put the following code in the Click event of one or more fields in the
continuous form in AnotherForm:
Me.Visible = False

Be sure to change "AnotherForm" to the name of your other form. Be sure to
change PKField to the name of the primary key field in both your forms.

I have assumed PKField has the same name in both forms and PKField is a
number.

Steve
(e-mail address removed)




I have a form that displays a record. But I'm working out a good way
to choose what record will be displayed. On this form is a button
which opens another form which will filter on several text boxes and
give me all matching records in a continuous form.
I would like to select one of those records and have it displayed in
the original form.
How do I do this???

Dave B- Hide quoted text -

- Show quoted text -

Thanks,

But I couldn't get that to work at all.

Dave
 
G

Gina Whipp

Dave,

What is the name of the first form? What is the name of the second form?
What are the fields that you want to filter on that are on both forms? Then
please review what you are trying to do...

1. Open form 1 with all records
2. Open form 2 based on filter
3. Make form 1 show the records in form 2 (not sure why that is needed as
they are already showing in form 1)

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

Dave

Dave,

What is the name of the first form?  What is the name of the second form?
What are the fields that you want to filter on that are on both forms?  Then
please review what you are trying to do...

1. Open form 1 with all records
2. Open form 2 based on filter
3. Make form 1 show the records in form 2 (not sure why that is needed as
they are already showing in form 1)

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm







- Show quoted text -

I have one form to display the record of a patient(frmRecipView). To
select a patient to view I have a button to open a search form
(frmRecipsearch). This form has a series of filters(which work nicely)
to filter through all the patient records. These records show up below
the filters in a continuous form. I would like to select one of those
records and have it populate the first form, but I can't seem to pass
the record over to the frmRecipview.

Thanks
 

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