|
|
How do I
change a field in a form to a list box or a combo box?
Open the form in
Design view, right-click the field, and choose Change To from the
shortcut menu. From the next menu that appears, choose List Box or
Combo Box, as desired. Depending on the size of the entries in the
original field, you may want to resize the control to add space for the
down arrow at the right of a combo box or the scroll bar in a list box.
Tip:
Once you've
changed the field, you will need to modify the Row Source Type and Row
Source properties for the list box or combo box, depending on what you
want the box to display. If you're not sure about how to do this,
you may be better off adding the list or combo box as a new field and
letting the Control Wizards automate the process. You can delete
the existing field, and make sure that the Control Wizards are turned on
in the Toolbox (the Control Wizards button should appear
depressed). Next, click the List Box tool in the toolbox (if you
want a list box) or click the Combo Box tool in the Toolbox (if you want
a combo box). Finally, click in the form where you want to place
the list or combo box. The wizard will ask you a series of
questions. Depending on your answers, the wizard will fill in the
Row Source and Row Source Type properties for you.
Top
How can I break the link to an attached
table?
In the Database
window, select the attached table. Open the Edit menu and choose
Delete or press the DEL key. In the dialog box that appears asking
for confirmation, click Yes. This deletes the link and removes the
name of the attached table from the list of tables in the Database
Window. Note that when you delete an attached table, you are
deleting only the information that Access uses to open that table.
You are not deleting the table itself. You can reattach the same
table again.
Top
Under the Database Utilities
option of the Tools menu there's an option for Make MDE file. What
does this do to my database?
Saving a database
as an MDE file results in a copy of the database that does not allow
changes to forms, reports or any Visual Basic for Applications (VBA)
code stored in that database. (You can make changes to tables,
queries and macros in a database that has been saved as an MDE
file). If your database contains VBA code, saving it as an MDE
file complies all modules removes all editable source code, and then
compacts the database. Any VBA code will continue to run, but it
cannot be viewed or edited. In addition to preventing changes by
unauthorized users, saving a database as an MDE file has performance
benefits. The size of your database will be reduced due to the
removal of the code, and memory usage is optimised improving
performance.
Caution:
If you save a database as an MDE file, be sure to maintain a copy of the
original database (.MDB) file in a secure location. You will need
it if you want to make any changes to the forms, reports or code that
are stored in the database.
Top
How can I type something into a text box on a form and use that
value to filter my query?
There is a
technique called query-by-form that you can use to accomplish
this. You enter an expression in the Criteria row of the query
that refers to the text box on the form, and you add a Search button to
the form that, when clicked, runs the query.
You can use the
following steps to implement query-by-form:
- Create a form
with text boxes you want to use to supply the desired criteria to
the query. You will need one text box for each cell in the
query that you want to provide criteria for. As an example, if
you wanted to fill in the City and State fields of a query based on
entries in a form, you would add two text boxes to the form.
- Turn on the
Control Wizards in the toolbox, if they are not already on.
- Add a command
button to the form. The Command Button Wizard dialog box will
appear. Under Categories, choose Miscellaneous. Under
Actions, choose Run Query. The click Next.
- In the next
dialog box, choose your query that will accept the values entered
into the form, then click Next.
- In the next
dialog box, click Text and enter an appropriate caption for the
button, such as "Search". Then click Finish to add
the button to the form.
- Save the form.
- Open the query
in Design view. In the Criteria row for each field that has a
corresponding text box on the form, you will need to enter an
expression like this Forms![Form Name]![Control Name] OR
- Forms![Form
Name]![Control Name] Is Null
- Where Form Name
is the name of your form, and Control Name is thename assigned to
the text control. For example, if you named the form
"Query People" and the form contained a text box named
"AskLastname," you would have an expression like this one
in the Criteria row of the Last Name field of the query grid:
- [Forms]![Query
People]![AskLastname] OR [Forms]![Query People]![AskLastname] Is
Null
- After saving the
query, you can open the form, enter criteria is one or more of the
text boxes, and click the button to run the query using the criteria
supplied.
Top
How can I create a startup form, or a form that initially appears
every time I open a database?
In earlier versions
of Access, this was commonly done with an Autoexec macro containing an
Open Form argument that opened the desired form. You can still do
it this way, but Access 97 provides an easier technique with more
options. With the Database window active, open the Tools menu, and
choose Startup. You will see the Startup dialog box, shown here.
Click the down
arrow at the right of the Display Form list box, and choose the form by
name that you want to open when the database is opened. You can
use the other options in this dialog box to hide the Database window, to
provide a title for the Application title bar, to display or hide the
full menus and built-in toolbars, to name any custom menus and menu bars
used by the database, and to specify an icon that appears in place of
the default Access icon in the Application title bar and in the Windows
Taskbar.
Top
How can I bring in data from a data source other than Access?
You can use the
following steps to bring in data from an external data source:
- Open the
database where you want to store the data, or create a new database
if you want the data stored in that database.
- Open the File
menu and choose Get External Data.
- From the next
menu that appears, choose Import.
- In the Import
dialog box that appears, choose the type of file under the Files of
Type box.
- Enter a name and
path for the file under File Name. (Alternately, you can use
the Drive and Folder icons at the top of the dialog box to navigate
to a folder where the file is stored, and select it).
- Click the Import
to bring the data into your Access database.
- Depending on the
type of data you are importing, Access may launch an Import Wizard
to help you complete the process. If that happens, answer all
of the questions in the Wizard.
Top

|
|
|