Hi
I am currently having problems getting two forms to behave the way I
want. I have two tables Student and Application, and their respective
forms. (Tables)Student has StudentID (PK) & an ApplicationID. And
Application has ApplicationID as its primary key.
With the main Form being the Student_Details form, I have a Button
which loads the Application Form. The way I want it to behave is when
the Load_AppForm button is clicked the following occurs; if an
applicationID exists in the student table then it loads the relevant
Application Details in the Application_Details form. Otherwise if the
Student table has no ApplicationID (ie, currently null, a new student)
then the Application Form will load to a new record, and then when all
data has been inputted here the ApplicationID is passed back to the
Student_Details form, and hence saved in the Student Table.
The following VB code within the Load_AppForm_Button_Click routine
doesn't quite work...and know that I will also need code behind the
Application Form as well.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Application_Details"
If Not IsNull([Forms]![Student_Details]![S_ApplicationID_txt])
Then
stLinkCriteria =
"[Forms]![Student_Details]![S_ApplicationID_txt]=" &
Me![ApplicationID_txt]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
DoCmd.OpenForm "Application_Details"
End If
Any advise would be greatly appreciated.
Thanks nic