?
Solved

How to pass multiple openargs

Posted on 2008-10-15
4
Medium Priority
?
707 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 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 2000 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

Industry Leaders: 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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 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