Reserved words

  • Thread starter Thread starter A Hopper
  • Start date Start date
A

A Hopper

I just read the posting Dates that mentioned "Date" is a
reserved word and should not be used to name anything in a
database. I was not aware of reserved words that should
not be use and have used "Date" throughout my database
(text boxes, fields, variables etc.. What is the best way
to remove it. What can be used instead of "Date".

Is there a list of reserved words?

Thanks for the help

Allan
 
Allan,
The most common mistakes in this regard are assigning the words 'Date' and
'Name' as field names.

1) You can simply change 'Date' to something like 'dteDate' or 'txtDate' or
'ADate'. I'm sure you get the point. If you have many tables using 'Date', I
would suggest you change the field name to something descriptive to that
table, i.e. 'OrderDate' in the Orders table, 'ShipDate' in the Shipping
table. It makes everything easier to follow and change.

2) You'll need to run through your database and change all instances.
One inefficient way is to change the field names one table manually, then do
the associated form, then it's queries, then reports, then code. When you do
code, it's probably best to enter the old field name and then search using
Edit + Replace. Click on the 'Current Project' button to comb the entire db
code. When done click the Compile tool button. You'll find out quickly
enough if you've overlooked a code entry. Then of course run the database
and see how you did.

When this is correct, go and do the same thing in each other table in order.
If you tried changing all the tables 'Date' field name, you'll have a hard
time to figure out which 'Date' in the code window refers to which table,
and what new descriptive name it should have.

I've not used it, but there is a download from SpeedFerret that will do all
of this for you.
http://www.speedferret.com

Ultimately, your method will depend upon how many instances of the field
name you have to change.

3) There are too many to list them all here.
Pick the KnowledgeBase article below that pertains to your Access version:

109312 'Reserved Words in Microsoft Access'
209187 'Acc2000: 'Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'

Have fun.
 
Fred,
I have a lot of work ahead of me to change all the
references.
I believe you also answered my posting "On Open - Size". I
thought I was done with that question.
I used
DoCmd.OpenReport, "ReportName",acViewPreview
DoCmd.RunCommand acCmdZoom100
in the On Click event of a command button to open the
report, however when I closed the report the form that had
the command button on it was also zoomed.
Let me know if you did answer my other posting and if you
want me to watch my original posting for your response.

Thank you again for your help
Allan
 
Allan,
When you Maximize any form or report, every thing else stays maximized
after the form or report is closed.

In the Report's close event, code:
DoCmd.Restore

When you now close the report, your form will be whatever
it was before you maximized the report.
 
Fredg said:
Allan,
When you Maximize any form or report, every thing else stays maximized
after the form or report is closed.

In the Report's close event, code:
DoCmd.Restore

When you now close the report, your form will be whatever
it was before you maximized the report.

That's what I thought too Fred, but Albert K. just posted an
answer (in formscoding) where he pointed out this
fascinating little tidbit:

The other forms will not maximize if the form that opened
the report has its Min/Max buttons disabled.
 
Back
Top