I can't save my table in Access. It says invalid field name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having alot of trouble saving my table. evey time I try to save it, it
says invalid field name. what am I doing wrong?
 
Pamela,

From Access Help (Guidelines for Naming Fields, Controls & Objects)

Names of fields, controls (control: A graphical user interface object, such
as a text box, check box, scroll bar, or command button, that lets users
control the program. You use controls to display data or choices, perform an
action, or make the user interface easier to read.), and objects in Microsoft
Access:

Can be up to 64 characters long.
Can include any combination of letters, numbers, spaces, and special
characters except a period (.), an exclamation point (!), an accent grave
(`), and brackets ([ ]).

Can't begin with leading spaces.

Can't include control characters (ASCII values 0 through 31).

Can't include a double quotation mark (") in table, view, or stored
procedure (stored procedure: A precompiled collection of SQL statements and
optional control-of-flow statements that is stored under a name and processed
as a unit. The collection is stored in an SQL database and can be run with
one call from an application.) names in a Microsoft Access project (Microsoft
Access project: An Access file that connects to a Microsoft SQL Server
database and is used to create client/server applications. A project file
doesn't contain any data or data-definition-based objects such as tables and
views.).

Although you can include spaces in field, control, and object names, most
examples in the Microsoft Access documentation show field and control names
without spaces because spaces in names can produce naming conflicts in
Microsoft Visual Basic for Applications (Visual Basic for Applications (VBA):
A macro-language version of Microsoft Visual Basic that is used to program
Windows applications and is included with several Microsoft applications.) in
some circumstances.

When you name a field, control, or object, it's a good idea to make sure the
name doesn't duplicate the name of a property (property: A named attribute of
a control, a field, or an object that you set to define one of the object's
characteristics (such as size, color, or screen location) or an aspect of its
behavior (such as whether the object is hidden).) or other element used by
Microsoft Access; otherwise, your database can produce unexpected behavior in
some circumstances. For example, if you refer to the value of a field called
Name in a table NameInfo using the syntax NameInfo.Name, Microsoft Access
displays the value of the table's Name property rather than the value of the
Name field.

Another way to avoid unexpected results is to always use the ! operator
instead of the . (dot) operator to refer to the value of a field, control, or
object. For example, the following identifier explicitly refers to the value
of the Name field rather than the Name property:

[NameInfo]![Name]

In addition to these guidelines, there are a number of Access Reserved Words
which you should avoid as field names. In most cases, Access will let you
name them, but unpredictable behavior will result. The most common abuses
are the reserved words Name and Date. Use FName, LName, and a descriptor
like EnrollDate instead.

Hope that helps.
Sprinks
 
I'm having alot of trouble saving my table. evey time I try to save it, it
says invalid field name. what am I doing wrong?

Using an invalid field name.

Check the names of your fields. It's best to use only the characters
A-Z, 0-9 and the _ underscore character in fieldnames; you can get
away with SOME other things but it's not infinitely flexible. For
example, you cannot use parentheses or square brackets in fieldnames
because they have meaning of their own.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top