Solved

OpenArgs issues

Posted on 2014-04-07
2
274 Views
Last Modified: 2014-04-07
Hi,

I have the following code on an OpenForm event:

Dim companyID As Long
Dim BatchID As Long
Dim strIDs() As Long
If Len(Me.OpenArgs & "") > 0 Then
    strIDs = Split(Me.OpenArgs, "|")
    companyID = strIDs(0)
    BatchID = strIDs(1)
    Me.txt_customer_id = companyID
    Me.txt_batch_id = BatchID
    
End If

Open in new window


The OpenArgs are being passed from one form to another with:

DoCmd.OpenForm "frm_reference_data", OpenArgs:=customer_id & "|" & batch_number


The on OpenForm codes errors out at strIDs = Split(Me.OpenArgs, "|") with:

RunTime Error 13 : Type Mismatch

Customer_id is = Text
Batch_number is = Number

Should I be putting quotes around the Batch Number or something?
0
Comment
Question by:anthonytr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39983308
You have CustomerID defined as Long.  You need to change it to String
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39983409
How have you declared srtIDs in the form open event?  Try:

Dim strIDs() as string
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Progress
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question