Understanding OpenArgs . .

Evagrius Ponticus

Well-known Member
Joined
May 24, 2007
Messages
1,467
Hi everyone,

I am trying to learn how to use OpenArgs . . I googled the property but I am a bit confused. What is the difference between the OpenArgs and just using a where condition or filter when opening a form . . .I am sure this is a stupid question but I suppose I have to learn . .

Thank you for any help . .
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
It's a good question ... I *think* that if the only reason for the OpenArg value was to set a filter, then using the WHERE parameter when opening is probably better.

On the other hand, you can pass almost any kind of information in an openargs variable - so its quite a bit more flexible. In fact, if you delimit your string variable, you could actually pass quite a lot of information (if you really want to).

I'd be curious to here of any common uses that others apply, but I don't actually use it a *lot* these days. Here's one possible reason borrowed from Denis' site:
http://www.datawright.com.au/access_resources/access_docmd.openform_arguments.htm
[The OpenArgs] setting can then be used by code in a form module , such as the Open event procedure . The OpenArgs property can also be referred to in macros and expressions . For example, suppose that the form you open is a continuous-form list of clients. If you want the focus to move to a specific client record when the form opens, you can specify the client name with the openargs argument, and then use the FindRecord method to move the focus to the record for the client with the specified name.
The difference here would be that the form is not filtered, but does open to a specific record.

Other thoughts that come to mind: putting a form in data entry mode, or setting it to read-only mode, depending on the circumstances under which it is opened.

Another thought that comes to mind: if you use an OpenArgs value to set the record source of the second form, it can't be "unfiltered", which would be a way to protect data.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top