Double Click

G

Guest

I'm trying to enter a double click command in an item in a look-up form so
that it opens up an individual record, but I cannot figure out the command.
I can go to a blank form, however, it's not going to the individual record.
 
K

Ken Ismert

Ronnie:

Form synchronization is one of the most basic problems facing new (and
experienced) Access developers. There are many possible solutions, each
with their advantages and drawbacks:

* Use a subform. The subform control allows you to specify a
Master/Child field link, which will sync the child to the parent

* DoCmd.OpenForm allows you to specify a WhereCondition, which will
specify the record that the child form displays.

* In the query for the child form, you can restrict key fields to
values parent form controls using the
[Forms]![ParentForm]![ParentControl] syntax.

These are the most common, because they require little or no code.
There are more sophisticated, code-based form sync schemes, but one of
the above will probably work for you.

-Ken
 
G

Guest

A tabbed look-up form was created from a table (not a query). In the
properties of the field and [Event Procedure] was set up "On DblClick". The
code states: Private Sub Last Name_DblClick (Cancel As Integer)
DoCmd.OpenForm "form name"
DoCmd.Find Record "field name"
End Sub

This opens a blank form, however does not find the record. Something must
be missing in the code, but I cannot figure out what.
 
K

Ken Ismert

Ronnie,

Look up the help for DoCmd.FindRecord. The code you have is incomplete.
FindRecord is a relatively weak way of searching for records on another
form, because it depends on that form being active. If the form you
expect isn't active, some other form will be searched, making the code
appear not to work.

Also, see thread "Find Record on Subform" for a code-based way of doing
this:

http://groups-beta.google.com/group...3fb76/630387c6608b4cef?hl=en#630387c6608b4cef

(watch for line wrap)

-Ken
 

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