Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to display data on a popup form related to data on a main form

Status
Not open for further replies.

DPROMICS

Technical User
Nov 5, 2003
108
US
I need to display and edit the data of records from a table that is the MANY part of a one to many relationship on a pop up form. The table that is the ONE part of the one to many relationship has its records displayed on the main form. I need on the pop up form to only see the records that are related to the currently selected entry of the table on the main form. Specifically:

1) I have a table, Tbl_PT_Demographics, that has a primary key called: PT_DB_Number. Each entry in that table is a patient's demographic data.

There is a second table called: Tbl_Coumadin_Clinic that has a foreign key called: PT_DB_Number. Each entry in this table is a patient's clinic visits data.

The table Tbl_PT_Demographics.PT_DB_Number is the ONE, of the one to many with the table, Tbl_Coumadin_Clinic.PT_DB_Number that is the MANY part of the relationship.

2) On the main form that is based on the table, Tbl_PT_Demographics I have a command button that causes a pop up form to open that prompts for a User ID and Password. If a valid User ID and Password entered is correct the form closes and it opens a new form.

3) The new form is based on the table Tbl_Coumadin_Clinic.

I want this form to only display in a list box and be able to edit the data for the currently selected records in the Tbl_Coumadin_Clinic entries for the currently selected record in the table, Tbl_PT_Demographics.

OK, I have tried searching the knowledge base on this forum and looked through a couple of books. But, I have not been able to figure out how to do it. It must be simple and I will probably do a "dope slap" to myself when I see how it is done. But for now how can I do this?

Best Regards.
 
Create a macro. Under Actions, it'll look like this:
Echo Under Action Arguments - Echo On = NO
Openform under Action Argu - Form Name = name of new form
Where condition will look like this
[Pt_DB_Number] = [Forms]![tbl_PT_Demographics_Form]![Pt_DB_Number]

Save and name the macro and place, the name on the OnClose event of the login form.
Note: the main form must remain open.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top