Connecting Tech Pros Worldwide Help | Site Map

can one pass more than 1 var to a form via openargs?

jim Bob
Guest
 
Posts: n/a
#1: Jan 24 '06
Just a quick question.
I have a docmd in the form of
DoCmd.OpenForm "frm_SearchResults", acNormal, , , , acWindowNormal,
Me.lstResults.Value

I currently pass Me.lstResults.value through and use this value etc
etc.. Is it possible to pass more than one variable?

Cheers.



*** Sent via Developersdex http://www.developersdex.com ***
Larry Linson
Guest
 
Posts: n/a
#2: Jan 24 '06

re: can one pass more than 1 var to a form via openargs?


OpenArgs, by definition, is a text string. You can separate items in that
string with appropriate punctuation, and separate them in code in the Open
event of the newly opened Form (or, with Access 2003, Report). Check Help
for the Split function for easy separation.

Larry Linson
Microsoft Access MVP

"jim Bob" <fromnz@gmail.com> wrote in message
news:bdgBf.76$H_2.11967@news.uswest.net...[color=blue]
> Just a quick question.
> I have a docmd in the form of
> DoCmd.OpenForm "frm_SearchResults", acNormal, , , , acWindowNormal,
> Me.lstResults.Value
>
> I currently pass Me.lstResults.value through and use this value etc
> etc.. Is it possible to pass more than one variable?
>
> Cheers.
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***[/color]


Mal Reeve
Guest
 
Posts: n/a
#3: Jan 24 '06

re: can one pass more than 1 var to a form via openargs?


When I need to do this I build up a string of the variables with a ";"
character between each one.
Then in the opened form I take the string apart for the segment I need...and
if necessary even convert back to a number etc.

Perhaps someone else will respond with a better solution - but this works
for me.
Mal.

"jim Bob" <fromnz@gmail.com> wrote in message
news:bdgBf.76$H_2.11967@news.uswest.net...[color=blue]
> Just a quick question.
> I have a docmd in the form of
> DoCmd.OpenForm "frm_SearchResults", acNormal, , , , acWindowNormal,
> Me.lstResults.Value
>
> I currently pass Me.lstResults.value through and use this value etc
> etc.. Is it possible to pass more than one variable?
>
> Cheers.
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***[/color]


jim Bob
Guest
 
Posts: n/a
#4: Jan 24 '06

re: can one pass more than 1 var to a form via openargs?


Yep, I've got that down pact. Thanks.

The form I open up actually gets its data from a query.
Therefore I get the var from openargs and read it like so:
([forms]![frm_SearchCandidates].[qmyList].[value])

I do not want to limit the query to get the var from only the
frm_SearchCandidate form.

Would a function be the way to go? I tried using an OR statement but
that didn't quite work the way I wanted it to.

THanks.

*** Sent via Developersdex http://www.developersdex.com ***
Steve Jorgensen
Guest
 
Posts: n/a
#5: Jan 24 '06

re: can one pass more than 1 var to a form via openargs?


As has been made clear, multiple values can be passed through a
delimited string, however that gets really messy really fast. We had a
long thread a while back discussing various ways around this problem,
mostly involving either witing to the form's properties after opening it
or placing objects into some sort of temporary holding before opening
the form, and having the form retrieve the data when it opens.

jim Bob wrote:[color=blue]
> Just a quick question.
> I have a docmd in the form of
> DoCmd.OpenForm "frm_SearchResults", acNormal, , , , acWindowNormal,
> Me.lstResults.Value
>
> I currently pass Me.lstResults.value through and use this value etc
> etc.. Is it possible to pass more than one variable?
>
> Cheers.[/color]
Closed Thread