How do you doubleclick on a recordset to open recordset in form vi

J

J. Keggerlord

Okay, this one is probably a no-brainer for you real programmers, but for
neophytes like me... Well, let's just say I should stick to my real core
competencies. In any case, here is what I have:

Results for a query are displayed on a continuous form (frmFirstForm). I
have a text box (txtSomeRecord) where I want the user to be able to
double-click the value and have it open that recordset in a different form
(frmEditTheRecord) for editing. For this hypothetical situation, the table
the original recordset came from is called tblSomeRecords.

Also, to save me asking a seperate question, if I have a joined table
(tblMoreRecordInfo) that has a one-to-many relationship with the first table,
joined on a similar field name (RecordInfo on frmFirstForm to MoreRecordInfo
on tblMoreRecordInfo), how can I open the recordset on the second table in a
form (frmFirstForm) by double-clicking the text box (txtSomeRecord) to get it
to open the recordset on the second table (tblMoreRecordInfo) in another form
(tblEditTheRecord)?

As always, your help is greatly appreciated (and I would even buy you a beer
if you got stuck in Seattle).
 
K

Klatuu

I will answer your question sort of in the reverse order they were asked,
because that is how, I hope, it will make the most sense.

First, as to the related table. I would suggest you create a form
(frmEditTheRecord) that has a record source that will present the table that
has the record you want to edit. Then, create a subform and use the Linked
Master/Child properties to link the related records in the child table. The
child table should be the record source for the sub form.

Now, when you want to launch the form, Use the Where argument of the
OpenForm method so the form will open showing the selected record.
 
J

J. Keggerlord

Do you have an example of what the code would look like (including variable
dims, etc.). Assume that my programming level is just below that of a howler
monkey with brain damage and three missing fingers. Thank you!
 
K

Klatuu

I would, but it is not so much coding as it is setting up the forms
correctly, so I don't know that I can cover everything here. The coding is
not much more that the OpenForm method.
DoCmd.OpenForm "FormName", , , "[SomeField] = '" & Me.AControl & "'"
 

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