Funky Save Record Stuff

N

Neil

Was working in A2003 and noticed that the Save Record item on the Records
menu was not available when the record was not dirty. In A2000, Save Record
was always available. (This is a problem for me because I have Docmd.Runcmd
acCmdSaveRecord code all over the place, which never gave an error before.
But now it was giving an error when the Save Record menu command wasn't
available.)

So I went back to A2000 and confirmed that the Save Record menu command is
always available, whether the record is dirty or not. So I concluded this
was a change in A2003, that the menu item's only available when the record's
actually dirty.

However...... when I went back to A2003 and tested it again, I noticed that
it was acting in the same way as A2000, with the Save Record menu item
always available!

So, in summary:

In A2003, Save Record menu item was only available when record was actually
dirty (causing an error when docmd.runcmd accmdsaverecord was run when the
record was not dirty).

Went to A2000 and confirmed that the menu item was always available, whether
the record was dirty or not.

And when I returned to A2003, all of a sudden the menu item was always
available, as it is in A2000, though a few minutes before it had only been
available when the record was dirty!

So I was wondering if anyone else has noticed these shenanigans from A2003,
or has any idea what's going on, and why the funcationality would change
like that. Also, how does A2003 act in your copy: is the Save Record menu
item always available; or is it grayed out when the record's not dirty?

Thanks!

Neil
 
N

Neil

I am using SP3, so I don't know about SP2. And, yes, mine is a SQL Server
backend (via ODBC) as well. Whatever happened (with Save Record not being
available in a non-dirty record), it cleared itself after going to A2000 and
then back to A2003 again. But the version of Access I'm using was the same
in both cases.
 
N

Neil

Lisa,

I'm not experiencing this problem. But, first, I never heard of Long
Varchar. I've heard of varchar and nvarchar. Are you referring to nvarchar?

Second, I'm not following what your problem is. You're trying to store an
empty string in a memo field and it's not getting converted to Null? Maybe
you can elaborate.
 
N

Neil

Lisa Moody said:
Neil,

I'm not the developer, I just posted what he sent to me about the issue.
Here's a definition of LONG VARCHAR (from my Google efforts):
The LONG VARCHAR type allows storage of character strings with a maximum
length of 32,700 characters. It is identical to VARCHAR, except that you
do
not have to specify a maximum length when creating columns of this type.

Looked into it a bit, and Long Varchar is not native to SQL Server. Perhaps
because you're using Sybase's product you have that field type.

Our problem is that via ODBC, Access 2000 and 2003 SP2 or lower, passes
the
null. All of a sudden our application started "hanging" on places where
we
have a memo type field. In-house testing found that with Access 2003,
SP3,
it is not passing the null over. Trying to programmatically dirty the
record with a space does not dirty it enough to pass the empty field to
the
SQL DB. We use Sybase's SQL Anywhere for our SQL solution.

I'm not experiencing that problem, and, as noted, I'm using A2003 SP3. I
just tested it with a memo field ("text" type field in SQL Server). With
nothing in the field, I modified a different field, and the record saved. I
tried it with the cursor in the empty memo field, as well as in the field I
had modified. No problem with saving.
When my developer read your problem, he believes it is a similar issue and
is happening in the same location. He couldn't get the Save Record if a
memo field is null. As soon as we put just a letter a in the field, it
passes over to the SQL fine.

Yeah, I don't think it's the same problem. I think mine was an intermittent
fluke. My Save Record command works fine (and has always worked fine) when
the record is dirty. My problem was that the Save Record command on the menu
bar was temporarily being disabled when the record wasn't dirty.
(Previously, the Save Record item wasn't disabled; but if the record wasn't
dirty, it just wouldn't do anything.)

Thus, I've never had any problem passing values over to SQL Server, whether
with a null memo field or otherwise. My only problem was that I was calling
docmd.runcmd accmdsaverecord at various points, which was failing if the
record wasn't dirty (and the Save Record command was disabled). But since I
went back to 2000 and then back again to 2003, it seems to have corrected
itself. The Save Record command is staying enabled at all times now.

Neil
 
T

Tony Toews [MVP]

Neil said:
Yeah, I don't think it's the same problem. I think mine was an intermittent
fluke. My Save Record command works fine (and has always worked fine) when
the record is dirty.

In A2000 this was true. But MS changed that behavior in A2003. You
need to add the following

if me.dirty=true then _
docmd.runcommand accmdsaverecord

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
N

Neil

Tony Toews said:
In A2000 this was true. But MS changed that behavior in A2003. You
need to add the following

if me.dirty=true then _
docmd.runcommand accmdsaverecord

Hi, Tony. I don't know if you read the initial post here, but I'm in A2003,
and the save record command is available always, just as in A2000. As I
noted, I experienced it only being available when the record is dirty, then
went back to A2000, and then back to A2003, and now it's available all the
time.

So, something strange is going on. If the behavior was changed in A2003 such
that it's not available when the record's not dirty, then why am I getting
it available when the record's not dirty (and that, after it was the other
way, only available when the record's dirty, for a short time)? Something
strange is going on.
 

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

Top