Go to specific record on form

M

Meaghan S

Hi

Let's say I have a form with a subform where one can enter information
about about magazine articles into my database. I also have another
form, (datasheet view) based on the results of a parameter query, that
shows a list of records matching the criteria of the query. This form
is read-only. Is there a way for me to go to a specific record on the
data-entry form by selecting one of the records from the list on the
datasheet form by linking the ID number? (I know how to get to a
specific numbered record, but how do I get to the record specified by
the ID key?)

Thanks,

M
 
K

KARL DEWEY

Create a text box on form where you want to locate the record and set the
Visible property to No.
I would use a double click event on the ID key text box to call a macro with
following actions.
- SetValue the invisible text box created above using expression
[Forms]![YourMainForm]![SubForm]![ID Key Text Box]
- GoToControl where you will find the record matching ID key.
- FindRecord using 'Find What' of the invisible text box.
- SetValue the invisible text box to Null.
 
M

Meaghan S

Hmm, I tried this, and found that the GoToControl doesn't work on a
control that is not visible...

Create a text box on form where you want to locate the record and set the
Visible property to No.
I would use a double click event on the ID key text box to call a macro with
following actions.
- SetValue the invisible text box created above using expression  
[Forms]![YourMainForm]![SubForm]![ID Key Text Box]
- GoToControl where you will find the record matching ID key.
- FindRecord using 'Find What' of the invisible text box.
- SetValue the invisible text box to Null.

--
Build a little, test a little.

Meaghan S said:
Let's say I have a form with a subform where one can enter information
about about magazine articles into my database. I also have another
form, (datasheet view) based on the results of a parameter query, that
shows a list of records matching the criteria of the query. This form
is read-only. Is there a way for me to go to a specific record on the
data-entry form by selecting one of the records from the list on the
datasheet form by linking the ID number? (I know how to get to a
specific numbered record, but how do I get to the record specified by
the ID key?)

M
.
 
K

KARL DEWEY

Ok, make it visible but transparent with all colors the same as the
background and sized verry, very small in a corner and behind something else.
--
Build a little, test a little.


Meaghan S said:
Hmm, I tried this, and found that the GoToControl doesn't work on a
control that is not visible...

Create a text box on form where you want to locate the record and set the
Visible property to No.
I would use a double click event on the ID key text box to call a macro with
following actions.
- SetValue the invisible text box created above using expression
[Forms]![YourMainForm]![SubForm]![ID Key Text Box]
- GoToControl where you will find the record matching ID key.
- FindRecord using 'Find What' of the invisible text box.
- SetValue the invisible text box to Null.

--
Build a little, test a little.

Meaghan S said:
Let's say I have a form with a subform where one can enter information
about about magazine articles into my database. I also have another
form, (datasheet view) based on the results of a parameter query, that
shows a list of records matching the criteria of the query. This form
is read-only. Is there a way for me to go to a specific record on the
data-entry form by selecting one of the records from the list on the
datasheet form by linking the ID number? (I know how to get to a
specific numbered record, but how do I get to the record specified by
the ID key?)

M
.

.
 
M

Meaghan S

Ok, so I figured it out without making it as complicated as the below
option. I thought I would post it, just in case somebody has a similar
need:

-make sure that you have the ID# on the edit form. (this can be set to
visibility=0 if you don't want people to see it)
-create a filter (query) that selects the ID# field from the article
with the condition set to the CONTROL value of the form you want to
link from. Give the filter a name.
-use the double-click event to create a macro on the field you want
to create the event. (I used the ID field on my form) simply use, OPEN
FORM. Set the filter name to your above selection.

this allows you to double click on the ID of a record on one form, and
it will take you to the specific filtered result on another form.
 

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