Find a record on one Form from another Form

  • Thread starter Thread starter Microsoft
  • Start date Start date
M

Microsoft

Greetings,

I am trying to get a form that lists guests to bring up a record of that
guest in my add/edit form. The list form is a filtered form with buttons on
it for the alphabet and you press a letter to get the list of guests with
that last name.

I want to click a name on the list in the guest list form and have the same
guest record appear for edit on my add/edit form. Right now I have to use
the find menu item to look for a name. This gets time consumign when doing
a lot of editing.

I have placed the following code on the OnClick event macro for he last name
on the form. The Macro Action is OpenForm. The form Name is frmGuests, the
view is Form, the where condition is:
[LastName]=[Forms]![frmGuestList]![LastName], the data mode is Edit and the
Window Mode is Normal.

Currently the OnClick action opens the form with a blank record. Anyone
have any thoughts on what I have missed or done wrong?

Many thanks.

Best regards,
Scott
 
Hi:

You probably haven't told the form where the record source is.

In your macro run the query for the records, if that doesn't do it add the
[Forms]![frmGuestList]![LastName] criteria under the [LastName] field of the
query.
 
Thanks for the quick response.

When I put the line in the macro to open the query, it returns only the
first record in query and won't allow it to change. If I put the
"LastName]=[Forms]![frmGuestList]![LastName]" string in the query it returns
no records on the form.

Any more thoughts?

Best regards,
Scott B


Bill Crawford said:
Hi:

You probably haven't told the form where the record source is.

In your macro run the query for the records, if that doesn't do it add the
[Forms]![frmGuestList]![LastName] criteria under the [LastName] field of the
query.

Microsoft said:
Greetings,

I am trying to get a form that lists guests to bring up a record of that
guest in my add/edit form. The list form is a filtered form with
buttons
on
it for the alphabet and you press a letter to get the list of guests with
that last name.

I want to click a name on the list in the guest list form and have the same
guest record appear for edit on my add/edit form. Right now I have to use
the find menu item to look for a name. This gets time consumign when doing
a lot of editing.

I have placed the following code on the OnClick event macro for he last name
on the form. The Macro Action is OpenForm. The form Name is frmGuests, the
view is Form, the where condition is:
[LastName]=[Forms]![frmGuestList]![LastName], the data mode is Edit and the
Window Mode is Normal.

Currently the OnClick action opens the form with a blank record. Anyone
have any thoughts on what I have missed or done wrong?

Many thanks.

Best regards,
Scott
 
I forgot to tel you that both forms use the same query.

Scott

Bill Crawford said:
Hi:

You probably haven't told the form where the record source is.

In your macro run the query for the records, if that doesn't do it add the
[Forms]![frmGuestList]![LastName] criteria under the [LastName] field of the
query.

Microsoft said:
Greetings,

I am trying to get a form that lists guests to bring up a record of that
guest in my add/edit form. The list form is a filtered form with
buttons
on
it for the alphabet and you press a letter to get the list of guests with
that last name.

I want to click a name on the list in the guest list form and have the same
guest record appear for edit on my add/edit form. Right now I have to use
the find menu item to look for a name. This gets time consumign when doing
a lot of editing.

I have placed the following code on the OnClick event macro for he last name
on the form. The Macro Action is OpenForm. The form Name is frmGuests, the
view is Form, the where condition is:
[LastName]=[Forms]![frmGuestList]![LastName], the data mode is Edit and the
Window Mode is Normal.

Currently the OnClick action opens the form with a blank record. Anyone
have any thoughts on what I have missed or done wrong?

Many thanks.

Best regards,
Scott
 
Greetings,

I am trying to get a form that lists guests to bring up a record of that
guest in my add/edit form. The list form is a filtered form with buttons on
it for the alphabet and you press a letter to get the list of guests with
that last name.

I want to click a name on the list in the guest list form and have the same
guest record appear for edit on my add/edit form. Right now I have to use
the find menu item to look for a name. This gets time consumign when doing
a lot of editing.

This suggests that you're making the rather common error of assuming
that Forms contain data. THEY DON'T. A Form *is just a window*,
displaying (and allowing you to edit) data that is stored in a Table.

Your second form should be bringing up data from your table; this
process can be made selective by using a Query with a criterion such
as

=[Forms]![yourfirstform]![controlname]
 
OK:

Give the add/edit form the record/control source or your macro is only going
to return one record.
form control source =
or [query]



Microsoft said:
I forgot to tel you that both forms use the same query.

Scott

Bill Crawford said:
Hi:

You probably haven't told the form where the record source is.

In your macro run the query for the records, if that doesn't do it add the
[Forms]![frmGuestList]![LastName] criteria under the [LastName] field of the
query.

Microsoft said:
Greetings,

I am trying to get a form that lists guests to bring up a record of that
guest in my add/edit form. The list form is a filtered form with
buttons
on
it for the alphabet and you press a letter to get the list of guests with
that last name.

I want to click a name on the list in the guest list form and have the same
guest record appear for edit on my add/edit form. Right now I have to use
the find menu item to look for a name. This gets time consumign when doing
a lot of editing.

I have placed the following code on the OnClick event macro for he
last
name
on the form. The Macro Action is OpenForm. The form Name is
frmGuests,
the
view is Form, the where condition is:
[LastName]=[Forms]![frmGuestList]![LastName], the data mode is Edit
and
the
Window Mode is Normal.

Currently the OnClick action opens the form with a blank record. Anyone
have any thoughts on what I have missed or done wrong?

Many thanks.

Best regards,
Scott
 
John,

I understand your point. But I am now very confused. I do not know where
to put what information. I think I need something in the on Dbl Clk event
in the guest list form to trigger the event. I think this needs to be a
macro. I also need something in the query that controls the add/edit form's
data to filter the data from the macro in the guest list form. Can you be
very specific about what goes where?

Many thanks,
Scott



John Vinson said:
Greetings,

I am trying to get a form that lists guests to bring up a record of that
guest in my add/edit form. The list form is a filtered form with buttons on
it for the alphabet and you press a letter to get the list of guests with
that last name.

I want to click a name on the list in the guest list form and have the same
guest record appear for edit on my add/edit form. Right now I have to use
the find menu item to look for a name. This gets time consumign when doing
a lot of editing.

This suggests that you're making the rather common error of assuming
that Forms contain data. THEY DON'T. A Form *is just a window*,
displaying (and allowing you to edit) data that is stored in a Table.

Your second form should be bringing up data from your table; this
process can be made selective by using a Query with a criterion such
as

=[Forms]![yourfirstform]![controlname]
 
HI:

The query is where you add the criteria to call the form up. There is a row
on queries called criteria. Your form name and field(s) are entered under
the query field your going to edit from the form. Like this

Query Window with Tables or subqueries
==============================================
field name: |[full name]
| [field2] etc
-----------+--------------------------------------------+-----------
criteria: |forms![EditFormName]![FieldInEditForm] |
|
|
-----------+--------------------------------------------+-----------
|
|

Microsoft said:
John,

I understand your point. But I am now very confused. I do not know where
to put what information. I think I need something in the on Dbl Clk event
in the guest list form to trigger the event. I think this needs to be a
macro. I also need something in the query that controls the add/edit form's
data to filter the data from the macro in the guest list form. Can you be
very specific about what goes where?

Many thanks,
Scott



buttons
on
it for the alphabet and you press a letter to get the list of guests with
that last name.

I want to click a name on the list in the guest list form and have the same
guest record appear for edit on my add/edit form. Right now I have to use
the find menu item to look for a name. This gets time consumign when doing
a lot of editing.

This suggests that you're making the rather common error of assuming
that Forms contain data. THEY DON'T. A Form *is just a window*,
displaying (and allowing you to edit) data that is stored in a Table.

Your second form should be bringing up data from your table; this
process can be made selective by using a Query with a criterion such
as

=[Forms]![yourfirstform]![controlname]
 
Back
Top