Is It Possibe?

Mahendra

Registered User.
Local time
Today, 14:26
Joined
Sep 19, 2013
Messages
62
Hello,

I have created a from which consists of search boxes in the above and the table in the below.

If we search for any in those search boxes then the results will be displayed at the bottom (The results will be displayed in the table which is located at the bottom of the page)

I had done with the above part.

My Requirement :

If I click on any of the row ín the results table then is it possible to display only the selected row in a new form????

If I search for a keyword MS in a search box and if it returns 40 results and if I click on any one of the result then the selected result should be opened in a new form.

Attached is my file. kindly have a look into it.
 

Attachments

Last edited:
Use the DoCmd.OpenForm to open a SingleForms version of your form.

There are several different ways to make the new form open at the selected record:
Pass the PK as the Where Argument of OpenForm.
Pass the PK via the OpenArgs argument of OpenForm.
Set the Recordset Property of the new form to the recordset property of the original form in the OnLoad Event of the new form.
 
Thanks for your reply.

Am Novice to MS Access. Could you kindly elaborate your above post please
 
Assuming MForm is your main form, the first step is to change the SourceObject of the subformcontrol to a form rather than a query. Queries don't have events so can't do what you want.

Make a form from the query and change the SourceObject of the subformcontrol to that form. Then set up the OnCurrent Event Procedure of the subform.

In this procedure include a line something like this, assuming DForm is the form you want to open:

Code:
DoCmd.OpenForm "DForm", , ,"[Author ID]=" & Me.[Author ID]
 
However on looking a little deeper into your databse I can see that you need to learn about normalization. It is essential you understand this concept and restructure your data before you go any further. Otherwise you will have no end of trouble.

The Author table is not a correct data model. You need a Many-to-many relationship. There should be another separate table for Titles plus a junction table with records to connect Authors and Titles using the Primary key of Author and Title records.

Search the forum and internet for information about normalization and Many-to-many relationships.
 

Users who are viewing this thread

Back
Top Bottom