Solved

OpenArgs issues

Posted on 2014-04-07
2
273 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 36

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

730 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