Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    Belfast, UK
    Posts
    87

    Unanswered: using multiple openargs

    hi can anyone give me help on using more than one openarg.

    currently I'm using

    Private Sub CmdOK_Click()
    On Error GoTo Err_CmdOK_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    StrArg = Me.txtreportname

    stDocName = "frmReport"
    DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal, StrArg
    DoCmd.Close

    Exit_CmdOK_Click:
    Exit Sub

    Err_CmdOK_Click:
    MsgBox Err.Description
    Resume Exit_CmdOK_Click
    End Sub

    I would like to add.
    intcomp = me.txtcomp (number)
    then retrive this on the form that is being opened.

    so it'll be something like
    DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal, StrArg & Intcomp

    so how do i then retreive the data on the other end?

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: using multiple openargs

    Originally posted by bertthefreak
    hi can anyone give me help on using more than one openarg.

    currently I'm using

    Private Sub CmdOK_Click()
    On Error GoTo Err_CmdOK_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    StrArg = Me.txtreportname

    stDocName = "frmReport"
    DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal, StrArg
    DoCmd.Close

    Exit_CmdOK_Click:
    Exit Sub

    Err_CmdOK_Click:
    MsgBox Err.Description
    Resume Exit_CmdOK_Click
    End Sub

    I would like to add.
    intcomp = me.txtcomp (number)
    then retrive this on the form that is being opened.

    so it'll be something like
    DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal, StrArg & Intcomp

    so how do i then retreive the data on the other end?
    Code fragment showing my technique:

    Code:
    Private Sub Form_Open(Cancel As Integer)
        Dim IsOK As Integer
    
        MyUserID = CurrentUser()
        DBConnectionActive = False
        EditPerformed = False
        
        If Not IsNull(Me.OpenArgs) Then
        
            Dim ParmListString() As String
            ' Format:
            '
            ' Item ID, Order Quantity
            '
           
            ParmListString = Split(Me.OpenArgs, ",", -1, vbTextCompare)
            SrcItemID = CLng(ParmListString(0))
            OrderQty = CDbl(ParmListString(1))
            AvailableQty = OrderQty
            OrderQtyLbl.Caption = ParmListString(1)
            AvailQtyLbl.Caption = ParmListString(1)
        Else
            MsgBox "This form can only be activated from within the Purchase Request form"
            Cancel = 1
            Exit Sub
        End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •