Dim stDocName

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
 
D

Dirk Goldgar

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.
 

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