tags:

views:

24

answers:

2

Hi

I would like to know what does this "acDialog, "x" means? it's a VBA code.

Case "btnInfo" DoCmd.OpenForm "Info", , , , , acDialog, "x"

+1  A: 

The "x" at the end is a parameter that gets sent to the form's OnLoad event and to its OpenArgs property. It's basically a parameter that helps the form initialize itself somehow (think class constructor parameters).

Blindy
ok, how can I have the form with maximize and minimize button? Because now if I open the form, I only have the close button. "x" here has nothing to do with the close button?Thanks
tintincute
No, nothing to do with the close button. It's more akin to the `Tag` property from VB6. It's just an object you set to use later on. It's only for you and your code, nothing else.
Blindy
+1  A: 

Should be

OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)
         "Info"  ,     ,           ,               ,         , acDialog, "x"

The dialog is the window mode for the form being opened, so open as a dialog. The "x" is the open args, which will set the form's OpenArgs property, which subsequent code within the form can access. But this is not like a constructor, more like setting a property of the form object.

Andrew
thanks. When I tried to eliminate the "x" at the end and only have the acDialog, it works the same way as I have the "x" at the end. So I don't really see the difference.
tintincute
Unless the form "Info" actually contains code that references the OpenArgs property, you won't have any difference - it would be passing a value that is just subsequently ignored.
Andrew