OpenArgs problem I think

  • Thread starter Thread starter CD Tom
  • Start date Start date
C

CD Tom

Not to sure what's happening but I've started using the OpenArgs option in
the Docmd.openform and now the criteria doesn't seem to be working. Is there
a problem when using the Openargs statement? the docmd looks like this
DoCmd.OpenForm stDocName, , , StLinkCriteria, , ,OpenArgs:=VRecordSource
the stLinkCriteria is set to Dept = 1 or 2 depending on the Dept and the
Vrecordsource is the record I want to use. I'm using the same form with
different recordsources. Thanks for any help.
 
OpenArgs passes a string value to the form being opened, but unless you have
code in that newly opened form that reads the OpenArgs property and does
something with it, it has no effect on the criteria. Without seeing more of
your code, it's impossible to give any suggestions for what may be happening
here.
 
CD Tom said:
Not to sure what's happening but I've started using the OpenArgs option in
the Docmd.openform and now the criteria doesn't seem to be working. Is
there
a problem when using the Openargs statement? the docmd looks like this
DoCmd.OpenForm stDocName, , , StLinkCriteria, , ,OpenArgs:=VRecordSource
the stLinkCriteria is set to Dept = 1 or 2 depending on the Dept and the
Vrecordsource is the record I want to use. I'm using the same form with
different recordsources. Thanks for any help.

I think the problem here is that you're attempting to mix positional
arguments with named ones. That line ought to read either:

DoCmd.OpenForm FormName:=stDocName,
WhereCondition:=StLinkCriteria,OpenArgs:=VRecordSource

(that should be all one line of course)

or:

DoCmd.OpenForm stDocName, , , StLinkCriteria, , ,VRecordSource
 
Back
Top