Dim stDocName

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

Can you please tell me what is the idea of opening a form
with

Dim stDocName As String
Dim stLinkCriteria As String

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


Instead of
DoCmd.OpenForm "FrmSelectStyleforItemInfo"

Thanks
 
Jack said:
Can you please tell me what is the idea of opening a form
with

Dim stDocName As String
Dim stLinkCriteria As String

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


Instead of
DoCmd.OpenForm "FrmSelectStyleforItemInfo"

Thanks

Nothing but flexibility. You might modify the code to set stDocName in
a variety of ways and from a variety of sources, and you might set
stLinkCriteria to a "where-condition" to filter the form on open. It
may also be that the wizards generate this code for their own
convenience, as the basic OpenForm code can be stored and reused over
and over, while the wizard only has to insert lines to make the code do
different things, rather than modifying the stored lines of code.
 
Back
Top