Eval with DoCmd.Openform

G

Guest

Is there anyway to use Eval to programatically open up a form with arguments?
For example I get an error when trying to do the following:

eval("DoCmd.OpenForm
""frmSelect_RejectedDeliverables"",0,,,1,3,""openargs1"")")

I get the Run-time error '2431' The expression you entered contains invalid
syntax.

If I do it without the openargs it will open fine.

Thanks
 
T

Tim Ferguson

Is there anyway to use Eval to programatically open up a form with
arguments?
For example I get an error when trying to do the following:

eval("DoCmd.OpenForm
""frmSelect_RejectedDeliverables"",0,,,1,3,""openargs1"")")

What are you trying to achieve here?

If you are trying to adjust which form gets opened according to some user
input, you can put its name in a variable:

if a = 6 then
strFormName="frmNewUser"
else
strFormName = "frmEditDetails"
end if

docmd.openform strformname, etc

Hope that helps...


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top