We help IT Professionals succeed at work.

how to pass an argument from one form to another form in MS ACCESS 2003

Medium Priority
328 Views
Last Modified: 2012-03-26
I'm trying to pass an argument from one form to another. I don't know how to do this. I want the second form to use the argument passed by the first form as a criteria but don't know how to do this.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2013
Commented:
Couple of ways to do this:

1 - OpenArgs when you use VBA to open Form2:

Docmd.OpenForm "Form2", OpenArgs:="Something"

and in form 2, refer to the OpenArgs like this:

PassedArgument = Me.OpenArgs



OR
2.  If you want to use criteria from Form1 to filter the records in Form2:

Docmd.OpenForm "Form2", WhereCondition:="ID=" & Me.ID

Author

Commented:
mbizup - Thanks it worked. Sorry I didn't get back to you sooner. I've just been extremely busy.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2013

Commented:
Glad that helped out :-)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.