Solved

OpenArgs issues

Posted on 2014-04-07
2
272 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 35

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This is about my first experience with programming Arduino.
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.

840 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