Solved

OpenArgs issues

Posted on 2014-04-07
2
261 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
2 Comments
 
LVL 34

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 47

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now