Book

Suggestions


Enter your email address:

Delivered by FeedBurner



Use your pdf converter to make your pdf files easy! You can now buy software that makes converting pdf to doc possible! Did you know you can even convert pdf to word?
Home Page

Bloglines

1906
CelebrateStadium
2006


OfficeZealot

Scobleizer

TechRepublic

AskWoody

SpyJournal












Subscribe here
Add to 

My Yahoo!
This page is powered by Blogger. Isn't yours?

Host your Web site with PureHost!


eXTReMe Tracker
  Web http://www.klippert.com



  Thursday, December 24, 2009 – Permalink –

List Fields in Access Tables

Bit o' code


When viewing a table that has many fields in Design view, you have to scroll up and down to review the field names.

This can be tiresome when you're referring to them constantly, and particularly when you're working with several tables.

The following code produces a field listing for a given table. This can then be copied to Notepad and printed for easy reference.

Enter the code into a module, substituting your table's name where appropriate.

Open the Debug/Immediate window, type ListFields,

Press Enter to produce the listing.
Sub ListFields()
Dim dbs As DATABASE
Dim dbfield As Field
Dim tdf As TableDef

Set dbs = CurrentDb
Set tdf = dbs.TableDefs!NAMEOFYOURTABLE

Debug.Print ""
Debug.Print "Name of table: "; tdf.Name
Debug.Print ""

For Each dbfield In tdf.Fields
Debug.Print dbfield.Name
Next dbfield
End Sub




See all Topics

Labels: , ,


<Doug Klippert@ 3:33 AM

Comments: Post a Comment


  Friday, November 13, 2009 – Permalink –

Link to Office Documents from Access

Click to Word, PowerPoint, Excel


You can create hyperlinks in Access that jump to other Office documents. The process of specifying the document and the bookmark you want to jump to can be cumbersome.

There's an easy way to specify where in a Word, Excel or PowerPoint document that a hyperlink should jump to, without even having to open the Insert Hyperlink dialog box.

  1. Open the target document and the Access table that contains a hyperlink field.

  2. Select some of the text at the beginning where you want the hyperlink to jump.

  3. Hold down the Ctrl key, drag the selection to the Access hyperlink field you want to set up.

  4. When you release the mouse button, the previously selected text is used as the hyperlink text and the link becomes active.




See all Topics

Labels: , ,


<Doug Klippert@ 3:44 AM

Comments: Post a Comment


  Thursday, October 08, 2009 – Permalink –

Copy Paste

Excel tables


One way to create a new table in an Access database from information included in an Excel spreadsheet is to select the pertinent data on the spreadsheet, including the field names.

Copy the selection (Edit>Copy, or CTRL+C)

Switch back to Access .

With Tables objects being shown in the database window, choose Edit>Paste, or use the CTRL+V shortcut.

Access will ask if the first row contains the field names and then will paste the information as a new database table.




See all Topics

Labels:


<Doug Klippert@ 3:47 AM

Comments: Post a Comment


  Thursday, July 16, 2009 – Permalink –

Access-Excel-XML-HTML

Transfer data


XML makes data transferable between applications.
Here is a tutorial with downloadable files.
Some simple guidance of how to transfer data from Excel or Access into HTML web pages using XML data files. VBA programs can be used to export data tables from Excel or Access into simple XML files. There are several examples of using different methods to display the XML and XSL files on web pages in order to quickly share your data with others.


An introduction to Excel and XML data files

 
Also:
Some nice photos and calendar layout:
Monthly calendar with photos




See all Topics

Labels: ,


<Doug Klippert@ 3:55 AM

Comments: Post a Comment


  Wednesday, June 10, 2009 – Permalink –

Automaticaly Setup a Database

Link in a snap


When you're creating a new database that will link to data that isn't in an Access format, you can speed up the setup process.

Rather than creating a new database and then using the File>Get External Data>Link Tables,

  1. Choose File>Open from the menu bar

  2. Select the appropriate data format from the Files Of Type dropdown list

  3. Open the file as you would any Access database
Access will automatically create an MDB file with the same name as the data source you selected and will set up links to the data.




See all Topics

Labels: , ,


<Doug Klippert@ 3:55 AM

Comments: Post a Comment


  Sunday, May 17, 2009 – Permalink –

New Fields from Datasheet View

Table fields on the fly



We all, of course, pre-plan our table layouts. However, if you need to create a table field while working in Datasheet view, you don't have to switch to Design view.

There's a quick way to create a field from Datasheet view.

Right-click on the column heading of the column you want to the right of your new field.
Choose Insert Column from the shortcut menu.

Access creates a field with a name such as "Field1".

You can then immediately start entering data in. You can also use the shortcut menu to rename or delete the newly created field.

Later you can go to Design view to set the field's properties.




See all Topics

Labels: ,


<Doug Klippert@ 3:19 AM

Comments: Post a Comment


  Sunday, April 26, 2009 – Permalink –

Composite Keys

Multi-Field Keys


To quickly create a multi-field primary key, while in the table's Design View:
  1. Hold the Ctrl key and click each field that you want to make up the primary key.
  2. Choose Edit>Primary Key from the menu bar, or click the Primary Key button on the toolbar
Access creates the composite primary key for you.

University of Texas at Austin:
Primary and Foreign Keys




See all Topics

Labels: ,


<Doug Klippert@ 3:05 AM

Comments: Post a Comment


  Saturday, April 18, 2009 – Permalink –

Duplicate Table Structures

No need to reinvent


When setting up a database, you may find that there is a table structure in another database that would be appropriate. You could Import the table, but then you have to clear out the useless records.

Here's an easier way to do it:
  1. Choose File>Get External Data>Import from the menu bar
    (External Data tab in 2007, then select Access in the Import group)
  2. Select the database that contains the tables you want to copy and click the Import button.
  3. Select the appropriate tables on the Tables sheet
  4. click the Options button, select the Definition Only option and click OK
.

To export a table definition from your current database to another:
  1. Select the appropriate table in the Database window.
  2. In Access 2000 and above, choose File>Export.
    (If you're using Access 2007, choose More in the Export group)
  3. Click OK.
  4. Now, regardless of version, select the target database and press Enter
When the Export dialog box appears, select the Definition Only option button and click OK. See all




See all Topics

Labels: ,


<Doug Klippert@ 3:42 AM

Comments: Post a Comment


  Monday, March 30, 2009 – Permalink –

Linked Table Problems

Lost functionality


Have you found that you cannot update linked Excel tables in Access 2003?


If you have installed Microsoft Office 2003 Service Pack 2 (SP2):


MORE INFORMATION
Because of legal issues, Microsoft has disabled the functionality in Access 2003 and in Access 2002 that let users change the data in linked tables that point to a range in an Excel workbook. However, when you make changes directly in the Excel workbook, the changes appear in the linked table in Access.


Support.Microsft.com:
You cannot change data in linked tables that are to an Excel workbook

You might try reinstalling and then only installing SP1.


Also:

VB123.com:
Guacamole dipped - Access to Excel linked table gotcha

PCWorld.com:
Patent ruling costs Microsoft $8.9 million


"A jury in U.S. federal court found that Microsoft infringed on a Guatemalan inventor's 1994 patent on technology linking the company's Access and Excel programs, and ordered the world's largest software maker to pay $8.9 million in damages.



See all Topics

Labels: ,


<Doug Klippert@ 3:17 AM

Comments: Post a Comment


  Friday, February 13, 2009 – Permalink –

Data Modeling

Data bits and pieces

While a few of us may be guilty of constructing databases on the run, and then trying to clean up the mess later, the wise ones plan ahead.

What information will you need in the future? What reports are going to be requested? If you're the bean counter, do you need to count all the legumes?


"Data modeling is probably the most labor intensive and time consuming part of the development process. Why bother especially if you are pressed for time? A common response by practitioners who write on the subject is that you should no more build a database without a model than you should build a house without blueprints.

The goal of the data model is to make sure that the all data objects required by the database are completely and accurately represented. Because the data model uses easily understood notations and natural language, it can be reviewed and verified as correct by the end-users.

The data model is also detailed enough to be used by the database developers to use as a "blueprint" for building the physical database. The information contained in the data model will be used to define the relational tables, primary and foreign keys, stored procedures, and triggers. A poorly designed database will require more time in the long-term. Without careful planning you may create a database that omits data required to create critical reports, produces results that are incorrect or inconsistent, and is unable to accommodate changes in the user's requirements."

University of Texas at Austin
Introduction to Data Modeling

Finding the Perfect Fit
By Tim McLellan

AgileData.org:
Data Modeling 101

DataModel.org




See all Topics

Labels: , , ,


<Doug Klippert@ 3:47 AM

Comments: Post a Comment


  Sunday, January 18, 2009 – Permalink –

Normalization

Designing an efficient database

Here is an understandable article about how to put together a normalized database.

One topic covered is what should be used for a Primary or foreign key.
"In general, a key field should have these characteristics:

Should be One Field

It is possible to define multiple fields as the key fields of a table, but a single field is preferable. ...Far better to have a CustomerID number than a combination of other fields to define a customer.
Should be Numeric

Access offers an AutoNumber field that is a Long Integer which is ideal for key fields. These values are automatically unique for each record and supports multi-user data entry as well.
Should Not Change Over Time

A key field should not change over time. Once identified, like a social security number, it should never change.
Should be Meaningless
To ensure a key field doesn’t change over time, it should have no meaning and therefore no reason to change over time.


Here are a few of the other topic headings:

Understanding Your Data
  • What Data Do You Need?
  • What Are You Going to Do with the Data?
  • How Is Your Data Related to Each Other?
  • What Is Going to Happen to the Data Over Time?
  • Learn How to Use Queries
Database Normalization Tips By Luke Chung, Founder and CEO of FMS Inc
Also see: Knowledgebase #283878: Description of the database normalization basics
15seconds.com: Introduction to Relational Databases
and:
Normalization Model




See all Topics

Labels: ,


<Doug Klippert@ 3:54 AM

Comments: Post a Comment


  Monday, December 29, 2008 – Permalink –

Drag Data

Simple exchange


To transfer data from an Access query or table in another Office program, such as Word, there's no need to manually export the data.
  1. Open the target Office document

  2. Arrange both applications on the screen
    (Right-click an empty part of the Task bar and choose Tile Windows Vertically)

  3. Switch to Access and select the fields or records that you want copied

  4. When you've finished selecting the data, move the mouse pointer near the border of the selection until it turns into an arrow

  5. Finally, drag and drop the data to your target document
You can also select a whole table, go to Edit>Copy. Switch to Word or Excel and Paste.
It works in the other direction too. Select some Excel data. Switch to Access. While viewing the Tables Objects, Paste the Excel data. It will form a new table.



See all Topics

Labels: , ,


<Doug Klippert@ 3:57 AM

Comments: Post a Comment


  Thursday, December 18, 2008 – Permalink –

Source of Tables

Identify a linked Access table's source



When a database contains linked tables, you may need to find the location of the source file.
One way is to:
  1. Open the table in Design view

  2. Clicking Yes when Access informs you that some properties can not be modified.

  3. Right-click on the window's title bar

  4. Select Properties from the shortcut menu.

  5. The location will appear in the Description text box in the Table Properties dialog box.


(Use Shift+F2 to open the Zoom box, if necessary)



ComputerBooksOnline





See all Topics

Labels: ,


<Doug Klippert@ 3:38 AM

Comments: Post a Comment


  Tuesday, October 28, 2008 – Permalink –

Normalization Model

Excel Mock-up


Normalization, simplistically, is setting up tables of data so that information is entered only one time. Access is not as malleable as Excel, so for demonstration purposes, spreadsheet entries can be used to show the concept.

"This article explains how to use Microsoft Excel to create prototypes of your Access databases and how to make sure your data adheres to a set of rules called normal forms. Normal forms aren't hard to understand, and they're critical to designing useful databases."




Design Access databases with normal forms and Excel

Also see:

Database normalization Webcast

An Introduction to Database Normalization

Database normalization basics

Database Normalization Basics for Developers

Also see:

Tushar-Mehta.com:
Building and using a relational database in Excel


See all Topics

Labels: ,


<Doug Klippert@ 3:44 AM

Comments: Post a Comment


  Monday, July 07, 2008 – Permalink –

Hidden Tables

Don't peek


If you do not want the ordinary user to see a table in your database, you can hide it in the database windows so that other users cannot select it.

Preface the table's name with the four letters 'Usys'. For example, if your table's name is ProprietaryCosts , change it to Usys ProprietaryCosts. This makes your table into a system object which Access does not display.

To see this table later, in Tools>Options, on the View tab in the Show section, put a check mark by System objects.

If we agree among ourselves not to tell the uninitiated, no one need be the wiser.


Microsoft Office Online:
How to Hide Objects in the Database Window

Here's how it works in 2007:
Hide tables as system tables in Access 2007



See all Topics

Labels: , ,


<Doug Klippert@ 3:30 AM

Comments: Post a Comment


  Friday, June 20, 2008 – Permalink –

Import Queries

As Tables


If you want to use the results of a query, and you don't need to update the underlying tables, you don't have to import unnecessary data.

You can import the query as a new table.


  1. Select File>Get External Data Import from the menu bar.
    (External Data tab, Import in 2007)
  2. Select the appropriate database and click Import.
  3. Select the queries you want to import on the Import Objects dialog box's Queries sheet.
  4. Next, click the Options >> button and select the As Tables option button on the Import Queries panel.
  5. Finally, click OK

Access processes the queries and saves the results as a table with the same name as the original query.



See all Topics

Labels: ,


<Doug Klippert@ 6:49 AM

Comments: Post a Comment


  Monday, June 16, 2008 – Permalink –

Number Entries

Beyond AutoNumber


Embedding information in a Primary key or ID, can lead to trouble in the future.
(If the first three numbers are to represent the warehouse address, what happens if new addresses have four numbers?)

Autonumbering can give a false sense of order. There is an initial tendency to try to keep all database records in some order. This violates the sense of a relational database.

The records can be sorted or filtered as needed.

Still some record numbering scheme may be desired.

Allen Browne's Access tips:
Numbering Entries in a Report or Form

"In relational database theory, the records in a table cannot have any physical order, so record numbers represent faulty thinking. In place of record numbers, Access uses the Primary Key of the table, or the Bookmark of a recordset. If you are accustomed from another database and find it difficult to conceive of life without record numbers, check out What, no record numbers?"





See all Topics

Labels:


<Doug Klippert@ 6:28 AM

Comments: Post a Comment


  Tuesday, June 10, 2008 – Permalink –

Auto Link

Outlook Contacts in Access


Automatically set up links to data outside of Access.
It still works in Access/Outlook '07.

Try this:

  1. Choose File >Open from the menu bar.
    (Office button>Open in 2007)
  2. Under Files Of Type choose Outlook().
  3. Locate your Outlook PST files.
  4. Choose Contacts, or if you have set up separate files for different groups choose an appropriate one.
  5. The wizard walks you through the process of creating an Access database with a linked Contact table.




The changes made in Access will be reflected in Outlook and vice versa.

If you want to create a new database that will link to other data that isn't in an Access format, you can do it quickly.

The classic way is to use the File>Get External Data >Link Tables method.

However you can simply choose File >Open from the menu bar.

Select the appropriate data format from the Files Of Type dropdown list
(such as Microsoft Excel (*.xls)).

Open the file and Access will automatically create an MDB file with the same name as the data source you selected and will set up links to the data.

From there you can develop forms, queries and reports.



See all Topics

Labels: , ,


<Doug Klippert@ 7:46 AM

Comments: Post a Comment


  Saturday, June 07, 2008 – Permalink –

Good OLAP

More data


From Builders.com.com:

An introduction to the benefits of online analytical processing (OLAP)

"Every day we create reams of data in customer relationship management applications, order entry applications, and warehouse management systems. We're drowning in a sea of data. However, even with all that data we don't have a large amount of information. We have the ones and zeros of the transactions, but we don't have the answers we need to simple questions like:

  • "Why was March better than February?"
  • "Where is the sales force having the most success?"
  • "In what conditions does the sales team struggle with making sales?"


The article also has links to:

  • Oracle 9i makes data warehousing easy to implement
  • Seven highly effective steps to a smooth data warehouse implementation
  • Business intelligence is just a few steps away for SAP R/3 users
  • Resources for designing, planning, and implementing a data warehouse strategy
  • Making the operational case for data warehousing
  • TechRepublic Tutorial: Data warehousing defined


Also see:
OLAP Cube

Data Warehousing and OLAP
A Research-Oriented Bibliography


FAQ Excel 2007 – OLAP

Microsoft:

OLAP



See all Topics

Labels: , ,


<Doug Klippert@ 6:43 AM

Comments: Post a Comment


  Sunday, April 06, 2008 – Permalink –

Add a Table

Drag drop trick



While working with a query in Design view, you may find that you need to add a table or query. The "book" way to do it is to click the Show Table toolbar button, drag the appropriate objects from the list, and then close the dialog box.

There is another way to do this.


Drag the table or query object's icon from the Database window/Navigation pane directly to the top half of the query design grid.


You can also use this technique in Access's Relationships window




See all Topics

Labels: , ,


<Doug Klippert@ 6:50 AM

Comments: Post a Comment


  Tuesday, February 26, 2008 – Permalink –

Set Field Defaults

Speed up table creation with default field settings



When you add fields to a table, Access assumes you want to use a 50/255-character Text field by default. However, you may typically use a smaller field size or you may personally use Number fields more often than Text ones.


You can avoid having to change the size and data types for new fields by setting defaults that are appropriate to your own design habits. To do so:

  1. Choose Tools> Options from the menu bar and switch to the Tables/Queries sheet.

  2. Select the data type you use most from the Default Field Type dropdown list.

  3. Set the Text and Number sizes you usually want to use in the Default Field Sizes panel and

  4. Click OK.


In Access 2007 go to Access Options>Object Designers:





See all Topics

Labels: ,


<Doug Klippert@ 6:43 AM

Comments: Post a Comment


  Saturday, February 02, 2008 – Permalink –

Filter Multiple Selections

Table sorts


In a table's Datasheet view, you can filter multiple selections in a few simple ways.


In the first method, you select one of the fields you want to filter by and click the Filter By Selection button on the toolbar. Access filters the records by that selection. Next, select the second field you want to filter by and click the button again. Access filters the records even further by this second selection. Continue to follow these steps until you have filtered by the desired number of selections.


You can also use Filter by Form. Click the icon on the toolbar. In the displayed form, enter the criteria. You can use And/Or statements, such as "Boston" Or "San Francisco".
(Access will enter the quote marks for you.)


For the third option, you use the Advanced Filter>Sort feature. To do so, select Records>Filter>Advanced Filter>Sort from the menu bar. Access displays a grid similar to the Query By Example grid. Now, drag down all the fields you want to filter by from the field list. Then, in the Criteria cells enter the values you want to filter for. When you have finished, click the Apply Filter button to see the results.


Fourth, you could use Filter by input. Right click any entry in a field you want filtered. Enter the value in the Filter For box and hit Enter. You could then choose another field and sort again by another criteria.

Creating a Query would let you save your filter, but these methods can be used to quickly display the desired information in a table.

(In 2007 these options are on the Home tab in the Sort & Filter group)


Florida Gulf Coast University:
Sorting and Filtering


eHow.com:
How to Filter Records in a Microsoft Access Table


Microsoft Kb:
How to filter records in an Access database



See all Topics

Labels: , ,


<Doug Klippert@ 7:21 AM

Comments: Post a Comment


  Thursday, July 26, 2007 – Permalink –

Use a Table Alias

to change names in a query


When you need to change the table name referenced in an existing Access query, it can be a pain. This is especially true if the query contains a large number of fields.

You typically might use an alias when you need to relate a table to itself or tables have long or unwieldy names.

If you make a practice of always using aliases in your queries, you can easily change which table is used by changing the one occurrence of the original table name in the query's FROM clause.
  1. To set a table alias in the query's Design view,
  2. Right-click on the table field list and choose Properties.
  3. Then, enter the alias name you want to use in the Alias text box.





See all Topics

Labels: ,


<Doug Klippert@ 7:36 AM

Comments: Post a Comment


  Sunday, July 08, 2007 – Permalink –

Auto Number

Don't be smart



There should not be any "intelligence" in an AutoNumber field. It is meant as an index field and not anything else.

If the need should arise to reset the field, if your table does NOT contain any records, simply compacting the database again will set the Autonumber field back to 1.

Another way would be to delete the AutoNumber field and re-insert it in the table.

Here's a long way to start at a specific number.

  1. Create your table with an AutoNumber type field, but don't enter any records.
  2. Create another table with only a single Long Integer Number type field.
  3. This field must have same name as the AutoNumber field in the first table.
  4. Enter one record in the second table that is a number one less than the required start of the AutoNumber for the first table.
  5. Now create an append query to append the record in the second table to the first table and run the query.


You can now delete the second table and begin entering your data into the first table.

Also:

Access AutoNumber Reset

"This is some sample code that shows how to programmatically reset all AutoNumber fields in an Access Database to a correct value (whether it be 0 or the max value + 1). In addition, it contains code for Compacting and Repairing an MS Access Database. This is perfect for people who are working with a complicated Access Database and have experienced AutoNumber bugs!

And:

Creating an AutoNumber field from code



See all Topics

Labels:


<Doug Klippert@ 6:29 AM

Comments: Post a Comment


  Sunday, March 04, 2007 – Permalink –

Automatically Renumber Records

Been looking for this



What happens to a list when one record is deleted?

If you need to correct the numbering, see these instructions.

Automatically renumber the records in an Access table when one is deleted

from Martin Green - FontStuff.com



See all Topics

Labels:


<Doug Klippert@ 7:29 AM

Comments: Post a Comment