Solved

How to pass multiple openargs

Posted on 2008-10-15
4
676 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
[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
4 Comments
 
LVL 66

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 66

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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

615 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