Hi Cutepaloma -
I'm much more experienced with VBA, but I think the general concept I'm going to lay out should still be applicable. Suppose you have a button
cmdGetCourse and text box
txtEmployeeID on frmStudent. You can put all your code for opening frmCourse in the Click event for cmdGetCourse:
- Private Sub cmdGetCourse_Click()
-
-
If IsNull(Me.txtEmployeeID) Then
-
MsgBox "No employee ID present! Please try again..."
-
Exit Sub
-
Else
-
DoCmd.OpenForm "frmCourse",acNormal,,,,,Me.txtEmployeeID
-
EndIf
-
-
End Sub
-
This is a very basic subroutine of course, but notice the last argument in the OpenForm command. Whatever you put in here will get passed to frmCourse as a parameter. In the module for frmCourse, you can access it using Me.OpenArgs (look at the help pages for more information about OpenArgs) - and use it for whatever purpose you need within the code for frmCourse. Like I mentioned before, the syntax in VB.NET may be a bit different, but the logic will still be the same I think.
Another option for you to consider is setting up a global variable that holds the employee ID. Since it's global you would be able to access the variable from any module in your project, including frmCourse.
Hope this helps.