E
Emma
Hi all,
I am trying to pass values from one form to another via OpenArgs. In Case 1
the user selects the "Int" Option and frm_tbl_Contracts_Int is supposed to
pop open with values from the calling form poplulating the called form as
follows:
frm_tbl_MasterJobs!Job_ID populating frm_tbl_Contracts_Int!fk_Job_Id
frm_tbl_MasterJobs!cbo_Account_No populating
frm_tbl_Contracts_Int!txt_Account_No
frm_tbl_MasterJobs!cbo_Account_No.Column(1) populating
frm_tbl_Contracts_Int!Contract_Account_Name
The code on the Main form (calling form) is as follows:
Private Sub Frame_Contract_Type_AfterUpdate()
Dim MyOpenArgs As String
MyOpenArgs = Me!Job_ID & "," & Me!cbo_Account_No & "," &
Me!cbo_Account_No.Column(1)
Select Case Form_frm_Tbl_Master_Jobs!Frame_Contract_Type
Case 1
DoCmd.OpenForm "Frm_Tbl_Contracts_Int", , , , acFormAdd, , MyOpenArgs
Case 2
DoCmd.OpenForm "Frm_Tbl_Contracts_Biopsy", , , , acFormAdd
Case Else
DoCmd.GoToControl "Comments"
End Select
End Sub
The code in the called form is as follows:
Private Sub Form_Open(Cancel As Integer)
Dim txt_Account_No As String
Dim FK_Job_ID As Integer
Dim Contract_Account_Name As String
If IsNull(OpenArgs) = False Then
FK_Job_ID = Split(OpenArgs, ",")(0)
txt_Account_No = Split(OpenArgs, ",")(1)
Contract_Account_Name = Split(OpenArgs, ",")(2)
End If
End Sub
When I look at the variable MyOpenArgs using a msgbox in the calling form my
values are there.
When I use a msgbox in my called form to look at each of the individual
variable values fk_Job_Id, txt_Account_No, and Contract_Account_Name they are
there are coming over. But why are they not appearing in my text boxes?
I am trying to pass values from one form to another via OpenArgs. In Case 1
the user selects the "Int" Option and frm_tbl_Contracts_Int is supposed to
pop open with values from the calling form poplulating the called form as
follows:
frm_tbl_MasterJobs!Job_ID populating frm_tbl_Contracts_Int!fk_Job_Id
frm_tbl_MasterJobs!cbo_Account_No populating
frm_tbl_Contracts_Int!txt_Account_No
frm_tbl_MasterJobs!cbo_Account_No.Column(1) populating
frm_tbl_Contracts_Int!Contract_Account_Name
The code on the Main form (calling form) is as follows:
Private Sub Frame_Contract_Type_AfterUpdate()
Dim MyOpenArgs As String
MyOpenArgs = Me!Job_ID & "," & Me!cbo_Account_No & "," &
Me!cbo_Account_No.Column(1)
Select Case Form_frm_Tbl_Master_Jobs!Frame_Contract_Type
Case 1
DoCmd.OpenForm "Frm_Tbl_Contracts_Int", , , , acFormAdd, , MyOpenArgs
Case 2
DoCmd.OpenForm "Frm_Tbl_Contracts_Biopsy", , , , acFormAdd
Case Else
DoCmd.GoToControl "Comments"
End Select
End Sub
The code in the called form is as follows:
Private Sub Form_Open(Cancel As Integer)
Dim txt_Account_No As String
Dim FK_Job_ID As Integer
Dim Contract_Account_Name As String
If IsNull(OpenArgs) = False Then
FK_Job_ID = Split(OpenArgs, ",")(0)
txt_Account_No = Split(OpenArgs, ",")(1)
Contract_Account_Name = Split(OpenArgs, ",")(2)
End If
End Sub
When I look at the variable MyOpenArgs using a msgbox in the calling form my
values are there.
When I use a msgbox in my called form to look at each of the individual
variable values fk_Job_Id, txt_Account_No, and Contract_Account_Name they are
there are coming over. But why are they not appearing in my text boxes?