Updated to 2007 and...

  • Thread starter Thread starter MeSteve
  • Start date Start date
M

MeSteve

I was upgraded to 2007 and the following line throws an error:

Me.DateUpdated = Now()

This is the error I get:

Update or CancelUpdate without AddNew or Edit

If I correct this to work with 2007, will that line of code work with 2003?
 
MeSteve said:
I was upgraded to 2007 and the following line throws an error:

Me.DateUpdated = Now()

This is the error I get:

Update or CancelUpdate without AddNew or Edit

If I correct this to work with 2007, will that line of code work with 2003?


Depends on whether your project requires the bad reference
or not.

Well, maybe it's not a bad reference and there is something
else in your code that's causing that line to fail.
 
As Marsh suggested, when you have working code, then move to another
environment and the code goes SPLAT! you have to think about missing
references.

When moving to ACC2007 and previously working code fails, the first thing to
consider is whether the database's folder has been designated as a "Trusted
Location."

I'm told to do this you open A2007, click the "Office" button in the upper
left, go to Access Options/Trust Center and add the source file of the db to
the list of trusted locations.

Good Luck!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
I am getting the impression that you are not familiar with
libraries and think the problem is in the text box
expression. I am pretty sure that the real problem is that
one or more libraries used by your project is the wrong
version, in the wrong folder or was never installed on the
new machine. A missing reference can mess up all kinds of
things, most commonly the VBA library's functions, so the
error on your expression is just a symptom of a deeper
problem.

I don't use A2007, so I'm not sure where it is, but in
earlier versions the check list of library references is on
the VBA Editor's Tools - References menu item.

Checking Linq's idea is worth while too.
 
No idea about libraries, but I have all of the ones mentioned by Allen Browne
I am getting the impression that you are not familiar with
libraries and think the problem is in the text box
expression. I am pretty sure that the real problem is that
one or more libraries used by your project is the wrong
version, in the wrong folder or was never installed on the
new machine. A missing reference can mess up all kinds of
things, most commonly the VBA library's functions, so the
error on your expression is just a symptom of a deeper
problem.

I don't use A2007, so I'm not sure where it is, but in
earlier versions the check list of library references is on
the VBA Editor's Tools - References menu item.

Checking Linq's idea is worth while too.
--
Marsh
MVP [MS Access]

What is the bad reference? How else would I set the textbox control value?
 
And none of the checked references at the top of the list have MISSING: in
front of them? Try selecting any additional reference at random, back out of
the dialog, then go back in and unselect the one you just added. That's
usually sufficient to refresh all of the references. (If any of the checked
references do have MISSING: in front of them, unselect them, back out of the
dialog, then go back in and reselect them. Probably a good idea to write
down what they were before you delete them, since they'll be in the body of
the list afterwards, not at the top!)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


MeSteve said:
No idea about libraries, but I have all of the ones mentioned by Allen
Browne
I am getting the impression that you are not familiar with
libraries and think the problem is in the text box
expression. I am pretty sure that the real problem is that
one or more libraries used by your project is the wrong
version, in the wrong folder or was never installed on the
new machine. A missing reference can mess up all kinds of
things, most commonly the VBA library's functions, so the
error on your expression is just a symptom of a deeper
problem.

I don't use A2007, so I'm not sure where it is, but in
earlier versions the check list of library references is on
the VBA Editor's Tools - References menu item.

Checking Linq's idea is worth while too.
--
Marsh
MVP [MS Access]

What is the bad reference? How else would I set the textbox control
value?

:

MeSteve wrote:

I was upgraded to 2007 and the following line throws an error:

Me.DateUpdated = Now()

This is the error I get:

Update or CancelUpdate without AddNew or Edit

If I correct this to work with 2007, will that line of code work with
2003?


Depends on whether your project requires the bad reference
or not.

Well, maybe it's not a bad reference and there is something
else in your code that's causing that line to fail.
 
Did everything mentioned and nothing shows missing. Any more ideas? This is
not an issue inherant to 2007?

Douglas J. Steele said:
And none of the checked references at the top of the list have MISSING: in
front of them? Try selecting any additional reference at random, back out of
the dialog, then go back in and unselect the one you just added. That's
usually sufficient to refresh all of the references. (If any of the checked
references do have MISSING: in front of them, unselect them, back out of the
dialog, then go back in and reselect them. Probably a good idea to write
down what they were before you delete them, since they'll be in the body of
the list afterwards, not at the top!)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


MeSteve said:
No idea about libraries, but I have all of the ones mentioned by Allen
Browne
I am getting the impression that you are not familiar with
libraries and think the problem is in the text box
expression. I am pretty sure that the real problem is that
one or more libraries used by your project is the wrong
version, in the wrong folder or was never installed on the
new machine. A missing reference can mess up all kinds of
things, most commonly the VBA library's functions, so the
error on your expression is just a symptom of a deeper
problem.

I don't use A2007, so I'm not sure where it is, but in
earlier versions the check list of library references is on
the VBA Editor's Tools - References menu item.

Checking Linq's idea is worth while too.
--
Marsh
MVP [MS Access]


MeSteve wrote:
What is the bad reference? How else would I set the textbox control
value?

:

MeSteve wrote:

I was upgraded to 2007 and the following line throws an error:

Me.DateUpdated = Now()

This is the error I get:

Update or CancelUpdate without AddNew or Edit

If I correct this to work with 2007, will that line of code work with
2003?


Depends on whether your project requires the bad reference
or not.

Well, maybe it's not a bad reference and there is something
else in your code that's causing that line to fail.
 
Back
Top