Link Froms

A

Agnelo Fernandes

I have to link 2 forms. 1 form is the Main Form [Candidates attending in a
course] and 2nd form is a pop up form [Instructors delivering the course].
There will be 8-10 instructors delivering per course date. I have main form
in a seperate table and instructors delivering course in a seperate table. I
need the 2 forms to link by the course date. i am aware that by a subform
concept it will work but i am keen on setting a pop up form.
I am user courseID as a primary key in by 'candidate' table and it is a
foreign key in my 'instructor table'. I have linked the 2 through referential
integrity, but in still does not link i.e I still have to enter course dates
on both the tables.
What i actually want is to enter the course date only ONCE in the candidate
table and then the instructor table automatically picks it up and links 8-10
instructors on that day.

Any help
 
D

Damon Heron

If the courseId is the link then what does coursedate have to do with it?
Are there different instructors based on the coursedate? What is your table
structure?

If it is always the same instructors for a given course, then you could open
the popup with command button:
(substitute your names as needed)
Private Sub Popup_Click()
On Error GoTo Err_Popup_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPopUp"

stLinkCriteria = "[CourseID]=" & me![CourseID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Popup_Click:
Exit Sub

Err_Popup_Click:
MsgBox Err.Description
Resume Exit_Popup_Click
End Sub

Damon
 
J

joshua

Damon Heron said:
If the courseId is the link then what does coursedate have to do with it?
Are there different instructors based on the coursedate? What is your
table structure?

If it is always the same instructors for a given course, then you could
open the popup with command button:
(substitute your names as needed)
Private Sub Popup_Click()
On Error GoTo Err_Popup_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPopUp"

stLinkCriteria = "[CourseID]=" & me![CourseID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Popup_Click:
Exit Sub

Err_Popup_Click:
MsgBox Err.Description
Resume Exit_Popup_Click
End Sub

Damon



Agnelo Fernandes said:
I have to link 2 forms. 1 form is the Main Form [Candidates attending in a
course] and 2nd form is a pop up form [Instructors delivering the
course].
There will be 8-10 instructors delivering per course date. I have main
form
in a seperate table and instructors delivering course in a seperate
table. I
need the 2 forms to link by the course date. i am aware that by a subform
concept it will work but i am keen on setting a pop up form.
I am user courseID as a primary key in by 'candidate' table and it is a
foreign key in my 'instructor table'. I have linked the 2 through
referential
integrity, but in still does not link i.e I still have to enter course
dates
on both the tables.
What i actually want is to enter the course date only ONCE in the
candidate
table and then the instructor table automatically picks it up and links
8-10
instructors on that day.

Any help
 

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