UserForm Question...Yeah..It's Me Again...

Challseus

Board Regular
Joined
Feb 5, 2003
Messages
141
Okay, my VLookup probelm is behind me. Now, if a value I'm looking for isn't found, I want a particular UserForm to be shown. Now, I'm used to Excel-VBA where you can do UserForm.Show.

What is the equivalent of this in Access?

P.S. I'm really not a lazy person, I really am trying on my own.
EDIT: **** help files aren't installed and my boss can't find CD, doh...
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hello,

In Access, the DoCmd object should become your new best friend. Most operations regarding opening and closing queries, tables, forms can be done with this. To open a form try this:-

DoCmd.OpenForm "YourFormName", acNormal

The full syntax from the help files ( :p ) is here:-

OpenForm Method


The OpenForm method carries out the OpenForm action in Visual Basic. For more information on how the action and its arguments work, see the action topic.

Syntax

DoCmd.OpenForm formname[, view][, filtername][, wherecondition][, datamode][, windowmode][, openargs]

The OpenForm method has the following arguments.

Argument Description
formname A string expression that's the valid name of a form in the current database.
If you execute Visual Basic code containing the OpenForm method in a library database, Microsoft Access looks for the form with this name first in the library database, then in the current database.
view One of the following intrinsic constants:
acDesign
acFormDS
acNormal (default)
acPreview
acNormal opens the form in Form view.
If you leave this argument blank, the default constant (acNormal) is assumed.
filtername A string expression that's the valid name of a query in the current database.
wherecondition A string expression that's a valid SQL WHERE clause without the word WHERE.
datamode One of the following intrinsic constants:
acFormAdd
acFormEdit
acFormPropertySettings (default)
acFormReadOnly
If you leave this argument blank (the default constant, acFormPropertySettings, is assumed), Microsoft Access opens the form in the data mode set by the form's AllowEdits, AllowDeletions, AllowAdditions, and DataEntry properties.
windowmode One of the following intrinsic constants:
acDialog
acHidden
acIcon
acWindowNormal (default)
If you leave this argument blank, the default constant
(acWindowNormal) is assumed.
openargs A string expression. This expression is used to set the form's OpenArgs property. This 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.
This argument is available only in Visual Basic.


Remarks

The maximum length of the wherecondition argument is 32,768 characters (unlike the Where Condition action argument in the Macro window, whose maximum length is 256 characters).

You can leave an optional argument blank in the middle of the syntax, but you must include the argument's comma. If you leave a trailing argument blank, don't use a comma following the last argument you specify.
 
Upvote 0
I appreciate the help. I'm sure it will help and I'm eager to try it out, but it won't be till Monday when I can, so I'll keep you posted as to how it's coming.
 
Upvote 0

Forum statistics

Threads
1,221,543
Messages
6,160,422
Members
451,644
Latest member
hglymph

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