From: Don on
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.
--
Thanks,

Dennis
From: Jeff Boyce on
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.

"Don" <Don(a)discussions.microsoft.com> wrote in message
news:452F24DD-10B2-48A5-A9C7-D35A3074144B(a)microsoft.com...
> 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.
> --
> Thanks,
>
> Dennis


From: Dirk Goldgar on
"Don" <Don(a)discussions.microsoft.com> wrote in message
news:452F24DD-10B2-48A5-A9C7-D35A3074144B(a)microsoft.com...
> 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

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

(please reply to the newsgroup)

From: Don on

--
Thanks,

Dennis


"Dirk Goldgar" wrote:

> "Don" <Don(a)discussions.microsoft.com> wrote in message
> news:452F24DD-10B2-48A5-A9C7-D35A3074144B(a)microsoft.com...
> > 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
>
> --
> Dirk Goldgar, MS Access MVP
> Access tips: www.datagnostics.com/tips.html
>
> (please reply to the newsgroup)
>