First of all I have been working with Access 97 and this morning the owner
of the business phoned me to inform me that he had updated to Access 2000
and parts of my forms would not work anymore.
On my form I have a field "Expiry Date".When I put the following into the
AfterUpdate field, it adds 183 days to the current date, and displays it in
the "Expiry Date" field.
Me.ExpDate = DateAdd("d", 183, Me.Date)
Then I have a "Lot Number" that only exists on the form. When the date is
entered it produces a whole number that comes up in the "Lot Number" field.
This is done by pasting the following formula in the in the "Control
Source" field on the Data Tab of the "Lot Number" field.
=Right(Year([Date]),1) & Right("000" & Format([Date],"y"),3)
What changes do I have to make to make the above Access 2000 compatible.
Any help would be appreciated.
Thank you,
--
William Bradley
Come visit us at: http://www.catholicmissionleaflets.org
Free Rosaries available at the above. 8 2053
"Date" is a reserved word -- the builtin Date function returns the current
date -- and it is not good to use reserved words for the name of a Field, or
a Control. It is also not good to use the name of the Field for the Control
in which it is displayed, because it is confusing to us whether it is the
Field or the Control that is being referenced.
Access 2000 is "stricter" about some things of this kind than Access 97 is.
I'd guess if you changed these things, it would be a start. At least the
issue wouldn't be confused with some things that can, but don't always,
cause a problem.
Also, be sure you have a clean compile before you convert, and be sure you
are running all the Service Packs for Access 2000 (there are now three SPs
and, perhaps, a few hot-fixes). A trip to Office Update would be a good
idea, just to make sure... it's an option on the Windows Update screen that
you see when you click Windows Update in the Start Menu.
Larry Linson
Microsoft Access MVP
"William Bradley" <br******@magma.ca> wrote in message
news:QI********************@magma.ca... First of all I have been working with Access 97 and this morning the owner of the business phoned me to inform me that he had updated to Access 2000 and parts of my forms would not work anymore.
On my form I have a field "Expiry Date".When I put the following into the AfterUpdate field, it adds 183 days to the current date, and displays it
in the "Expiry Date" field.
Me.ExpDate = DateAdd("d", 183, Me.Date)
Then I have a "Lot Number" that only exists on the form. When the date is entered it produces a whole number that comes up in the "Lot Number"
field. This is done by pasting the following formula in the in the "Control Source" field on the Data Tab of the "Lot Number" field.
=Right(Year([Date]),1) & Right("000" & Format([Date],"y"),3)
What changes do I have to make to make the above Access 2000 compatible.
Any help would be appreciated.
Thank you,
-- William Bradley Come visit us at: http://www.catholicmissionleaflets.org Free Rosaries available at the above.
William Bradley wrote: First of all I have been working with Access 97 and this morning the owner of the business phoned me to inform me that he had updated to Access 2000 and parts of my forms would not work anymore.
On my form I have a field "Expiry Date".When I put the following into the AfterUpdate field, it adds 183 days to the current date, and displays it in the "Expiry Date" field.
Me.ExpDate = DateAdd("d", 183, Me.Date)
I think you should use the "correct" syntax... the "dot" operator is
used for methods/properties of the object eg. Me.Visible. For fields
use an apostraphy.
Me![ExpDate] = DateAdd("d', 183, Me![Date])
Also 'date' is a reserved word. Try calling your field something else.
Then I have a "Lot Number" that only exists on the form. When the date is entered it produces a whole number that comes up in the "Lot Number" field. This is done by pasting the following formula in the in the "Control Source" field on the Data Tab of the "Lot Number" field.
=Right(Year([Date]),1) & Right("000" & Format([Date],"y"),3)
What changes do I have to make to make the above Access 2000 compatible.
Any help would be appreciated.
Thank you,
--
regards,
Bradley
"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in
news:40******@nexus.comcen.com.au: William Bradley wrote: First of all I have been working with Access 97 and this morning the owner of the business phoned me to inform me that he had updated to Access 2000 and parts of my forms would not work anymore.
On my form I have a field "Expiry Date".When I put the following into the AfterUpdate field, it adds 183 days to the current date, and displays it in the "Expiry Date" field.
Me.ExpDate = DateAdd("d", 183, Me.Date)
I think you should use the "correct" syntax... the "dot" operator is used for methods/properties of the object eg. Me.Visible. For fields use an apostraphy.
Me![ExpDate] = DateAdd("d', 183, Me![Date])
Don't you mean "Catastrophe"?
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Lyle Fairfield wrote: "Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in news:40******@nexus.comcen.com.au:
William Bradley wrote: First of all I have been working with Access 97 and this morning the owner of the business phoned me to inform me that he had updated to Access 2000 and parts of my forms would not work anymore.
On my form I have a field "Expiry Date".When I put the following into the AfterUpdate field, it adds 183 days to the current date, and displays it in the "Expiry Date" field.
Me.ExpDate = DateAdd("d", 183, Me.Date)
I think you should use the "correct" syntax... the "dot" operator is used for methods/properties of the object eg. Me.Visible. For fields use an apostraphy.
Me![ExpDate] = DateAdd("d', 183, Me![Date])
Don't you mean "Catastrophe"?
hehe ;)
--
regards,
Bradley
> I think you should use the "correct" syntax... the "dot" operator is used for methods/properties of the object eg. Me.Visible. For fields
Which is why 'dot' can be used for the object properties that refer
to controls on the report, and to fields in the bound recordsource.
An advantage of using the form properties, instead of using members
from the fields collection or the controls collection, is that you
get 'autocomplete'. Another, more important advantage, is that you
get compile time syntax checking for form properties, which you do
not get for membership of collections.
Disadvantages of using field properties of a form are (1) 'Field'
properties are not created correctly when using LoadFromText,
(2) 'Field' properties are not available for late-bound recordsources.
I am not aware of any disadvantages to using 'control' properties.
I use the form properties when referring to a control on a form,
and use the default collection when referring to a field from the
recordsource (this gives me an additional visual indication for
when I am using a field without a bound control, and is tolerant
to forms that are unbound at compile time).
When I use the default collection of the form (frm!....) I
can refer both to controls and to unbound fields. There is no
overlap if I use the fields and controls collections (frm!controls!...
frm.recordsetclone.fields!...) By what magic is this possible?
I would think that perhaps using the default collection is a
kludge that should be avoided ????
(david)
"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message
news:40******@nexus.comcen.com.au... William Bradley wrote: First of all I have been working with Access 97 and this morning the owner of the business phoned me to inform me that he had updated to Access 2000 and parts of my forms would not work anymore.
On my form I have a field "Expiry Date".When I put the following into the AfterUpdate field, it adds 183 days to the current date, and displays it in the "Expiry Date" field.
Me.ExpDate = DateAdd("d", 183, Me.Date)
I think you should use the "correct" syntax... the "dot" operator is used for methods/properties of the object eg. Me.Visible. For fields use an apostraphy.
Me![ExpDate] = DateAdd("d', 183, Me![Date])
Also 'date' is a reserved word. Try calling your field something else.
Then I have a "Lot Number" that only exists on the form. When the date is entered it produces a whole number that comes up in the "Lot Number" field. This is done by pasting the following formula in the in the "Control Source" field on the Data Tab of the "Lot Number" field.
=Right(Year([Date]),1) & Right("000" & Format([Date],"y"),3)
What changes do I have to make to make the above Access 2000 compatible.
Any help would be appreciated.
Thank you,
-- regards,
Bradley
Larry Linson wrote:
Thank you to everyone who responded to my problem. I finished by creating a
fresh DB in Access 2000. It was not as though I had a big system to deal
with. The main reason was that I could not get a clean compile when 2000
was trying to update 97's DB. Once I did that, took not of what was told me
about the date being a reserved word, everything began to work as expected.
Thanks again, Bill. "Date" is a reserved word -- the builtin Date function returns the current date -- and it is not good to use reserved words for the name of a Field, or a Control. It is also not good to use the name of the Field for the Control in which it is displayed, because it is confusing to us whether it is the Field or the Control that is being referenced.
William Bradley
Come visit us at: http://www.catholicmissionleaflets.org
Free Rosaries available at the above.
"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in
news:40***********************@news.syd.swiftdsl.c om.au: I am not aware of any disadvantages to using 'control' properties.
If you mean referring to controls using the . operator, here are
some:
1. you are depending on the behavior of something over which you
have no control: VBA creates a hidden wrapper around each controls
that allows you to treat them as properties/members of the form.
2. in certain circumstances, the dot operator can lead to corruption
of the form. I've lost track of what those circumstances are,
though. Steve Jorgensen experienced one case of it, I think.
3. code written using the ! operator is easier to read, as it tells
you you're referring to a control or field.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
> 1. you are depending on the behaviour of something over which you have no control: VBA creates a hidden wrapper around each controls
Whereas when I refer to the 'visible' property of a form
I am depending on the behaviour of something over which I
do have control? And when I refer to the magic default
collection of the form I am depending on the behaviour of
something over which I do have control?
2. in certain circumstances, the dot operator can lead to corruption of the form. I've lost track of what those circumstances are, though. Steve Jorgensen experienced one case of it, I think.
Steve experienced a lot of corruption when he started using
Access 2000: Later, he didn't get as much corruption. The
same thing happened to me... I stopped using MDE libraries:
I couldn't get them to work reliably at all. He stopped using
form properties. Now, we have all our libraries back again,
and we continue to use dynamically created form properties as
well as public form variables, Let, and Get.
AFAIK, Steve never posted 'circumstances' that led to corruption,
except that developing VBA in Access 2000 can lead to project
corruption, and project corruption can lead to database
corruption. Always close and save after making changes: never
modify a form opened in view mode: always decompile after
setting break points: close, backup and decompile often.
Steve has gone on to write elaborate code to replace the
functionality of form properties: it would not be appropriate
to advise people to just abandon the use of form properties.
3. code written using the ! operator is easier to read, as it tells you you're referring to a control or field.
Code written using the ! operator is more difficult to read,
as it obscures the difference between controls and fields.
(david)
"David W. Fenton" <dX********@bway.net.invalid> wrote in message
news:Xn*********************************@24.168.12 8.86... "david epsom dot com dot au" <david@epsomdotcomdotau> wrote in news:40***********************@news.syd.swiftdsl.c om.au:
I am not aware of any disadvantages to using 'control' properties.
If you mean referring to controls using the . operator, here are some:
1. you are depending on the behavior of something over which you have no control: VBA creates a hidden wrapper around each controls that allows you to treat them as properties/members of the form.
2. in certain circumstances, the dot operator can lead to corruption of the form. I've lost track of what those circumstances are, though. Steve Jorgensen experienced one case of it, I think.
3. code written using the ! operator is easier to read, as it tells you you're referring to a control or field.
-- David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: jason |
last post by:
Hi Ray...a while ago you explained an elegant solution to enable me to
CREATE and EDIT existing tables and queries inside my online access 2000
database.... could you provide refresher links on...
|
by: John |
last post by:
Hi,
I've recently upgraded from Access 97 to Access 2002 & the performance
basically stinks. I have tried the following items listed below but it
has only had a minor impact:
1) Upgraded Jet...
|
by: bala |
last post by:
hi access gurus
would appreciate if u can give me pointers regarding conversion of ms
access 97 application to ms access 2000, like what are the problems to
be expected and how to handle it.
...
|
by: sparks |
last post by:
I have done a LOT of databases in access 97 but I am new to access
2000.
We are S L O W L Y converting over.
Yesterday I had a 97 database that I had to run the converter to 2000
and everything...
|
by: Derek Riley |
last post by:
I have been using Access97 for some time now and decided to upgrade to 2000,
the problem is when I convert it to 2000 I get the following message "There
were compilation errors during the...
|
by: Jeff |
last post by:
Does anyone know of any potential problems running a 2000 database with
2003?
Also, what about installing all other Office products as 2003 versions but
leaving Access as 2002 running a 2000...
|
by: Cy |
last post by:
Hello Fellow New Group Folks,
Here's today's problem. I was called in to help convert an Access 97
database to Access 2000. 99% of all my Access Dev. work has occurred
in 2000, so I know very...
|
by: Mell via AccessMonster.com |
last post by:
Is there a way to find out where an application was created from?
i.e. - work or home
i.e. - if application sits on a (work) server/network, the IT people know the
application is sitting...
|
by: ThePhenix |
last post by:
Hi everybody,
I have recently been doing a conversion for my boss for a access 2000 database (both front and backend) to a MSSQL backend.
I finished the conversion today (as quite a lot of the...
|
by: NEWSGROUPS |
last post by:
I am in the midst of trying to convert about 25 Access 2000 to Access 2003.
The new environment consists of Office/Access 2003 and Outlook 2003. When
converting the back ends I have no problems....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |