Solved

How to pass multiple openargs

Posted on 2008-10-15
4
619 Views
Last Modified: 2012-05-05
I have an Access form - sfrmANHC
I want to pass 2 openargs to the form, GrantExpenditures.  The 2 fields are grantid and agencyid.  Could someone help me with this?  
0
Comment
Question by:ksilvoso
  • 2
4 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 22722027
You have to pass them both in one string, separated by commas (or whatever), and then in your form.Open event parse the OpenArgs string into it's separate pieces.

OpenArgs does not support an array of multiple values.
0
 
LVL 1

Author Comment

by:ksilvoso
ID: 22722041
Could you give me a code example?
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 22722070
I don't have it on me, so I'll step back to encourage other experts to respond.
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 22722228

docmd.openform "GrantExpenditures", openargs:=me.grantid &";" & me.agencyid


now use the load event of form "GrantExpenditures" to get values

private sub form_load()
if len(me.openargs)> 0 then
      'pass the values accordingly
      me.grantid=split(me.openargs,";")(0)
      me.agencyid=split(me.openargs,";")(1)

end if

end sub



0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

744 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

13 Experts available now in Live!

Get 1:1 Help Now