?
Solved

OpenArgs issues

Posted on 2014-04-07
2
Medium Priority
?
275 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 38

Accepted Solution

by:
PatHartman earned 2000 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
ID: 39983409
How have you declared srtIDs in the form open event?  Try:

Dim strIDs() as string
0

Featured Post

Independent Software Vendors: 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…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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