stLinkCriteria

D

Don

This is the code in my button on a form that opens a pop-up form.

Dim stDocName As String
Dim stLinkCriteria As String

If IsNull(Me.PrintDate) And IsNull(Me.Date) Then

MsgBox "You did not enter a Work Order. Enter a Work Order, including
the Date, then press the Submit And Print Order Button."
Cancel = True
Date.SetFocus
Else
Me.Refresh

stDocName = "ADAfrm"
DoCmd.OpenForm stDocName, , , stLinkCriteria

End If

What does stLinkCriteria do? ADAfrm is a pop-up form with a yes and no
button that prints different reports.
 
J

Jeff Boyce

Don

Check Access HELP for the syntax that goes with the OpenForm command. It
explains the parameters.

By the way, if you actually have field named "Date", be aware that this is
a reserved word in Access. Access may not mean the same thing that you do
when you say Me.Date...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
D

Dirk Goldgar

Don said:
This is the code in my button on a form that opens a pop-up form.

Dim stDocName As String
Dim stLinkCriteria As String

If IsNull(Me.PrintDate) And IsNull(Me.Date) Then

MsgBox "You did not enter a Work Order. Enter a Work Order, including
the Date, then press the Submit And Print Order Button."
Cancel = True
Date.SetFocus
Else
Me.Refresh

stDocName = "ADAfrm"
DoCmd.OpenForm stDocName, , , stLinkCriteria

End If

What does stLinkCriteria do? ADAfrm is a pop-up form with a yes and no
button that prints different reports.


In this case, stLinkCriteria does nothing at all. In boilerplate code such
as that generated by the command button wizard, it would be used to supply
where-condition criteria for the form, to restrict its content. However, in
the above code the variable is never set to any value, and so is an empty
string. Passing an empty string for the OpenForm method's where-condition
argument is the same as not passing that argument at all, and so the above
call is equivalent to just writing:

DoCmd.OpenForm stDocName
 
D

Don

--
Thanks,

Dennis


Dirk Goldgar said:
In this case, stLinkCriteria does nothing at all. In boilerplate code such
as that generated by the command button wizard, it would be used to supply
where-condition criteria for the form, to restrict its content. However, in
the above code the variable is never set to any value, and so is an empty
string. Passing an empty string for the OpenForm method's where-condition
argument is the same as not passing that argument at all, and so the above
call is equivalent to just writing:

DoCmd.OpenForm stDocName

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 

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