values passed in OpenArgs not displaying in text boxes on called f

Tech-Archive recommends: Fix windows errors by optimizing your registry



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?







.



Relevant Pages

  • Re: Playing AVI and MPEG using MCI
    ... "mciSendStringA" (ByVal lpstrCommand As String, ... Dim mlRet As Long ... Private Sub CenterObject ... If mlRet 0 Then ...
    (microsoft.public.vb.controls)
  • Change this Program
    ... Private sPathFrom As String ... Private Sub enableControl ... Dim oColor As OLE_COLOR ... Dim sPathTo As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Error when running vb app with FlexGrid control
    ... Private Sub cmdNetChange_Click ... On Error GoTo Command1_Click_Error ... Private Sub fnGetData(strParam0 As String, strParam1 As String, FLX As ... Dim rsADOObject As Recordset ...
    (microsoft.public.vb.general.discussion)
  • Sum in a dynamic query
    ... Private Sub Form_Open ... Dim db As Database, Tbl As TableDef ... Dim db As Database, qd As QueryDef, ctl As Control, s As String, Item As ...
    (comp.databases.ms-access)
  • Re: How to add/load records to combobox ?
    ... Dim rsCustomers As New ADODB.Recordset ... Private msCustomerIDsAs String ... Private Sub Combo1_Click ... Dim sSQL As String ...
    (microsoft.public.vb.controls)