Solved

How to pass multiple openargs

Posted on 2008-10-15
4
628 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

910 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

20 Experts available now in Live!

Get 1:1 Help Now