Problems with a XP database in 2007

J

JesseAviles

I developed a database in XP that worked fine in XP and 2003 Access
versions (all machines are running Win XP SP2). The problem occurs in
a form that queries a recordset to assign a new record number (all
through code). The steps are as follows:
1. The user opens the form and goes to a new record (the form is
bound).
2. The user then populates the form as needed and clicks on Save
(custom command button).
3. The Save button runs code that checks if the ID is null. If the
ID is null, it opens a recordset looking for the last record and adds
1 to create a new record number (primary key). Otherwise it just
saves the record. (Office XP and 2k3 run Ok. I've used this technique
in other databases with no trouble.)

Walking through the code, I see that the Null validation fails because
the form (or Access) is reporting the ID of a previous record (created
when the form was running on an Office XP machine) and this causes
hell with the code that follows the validation. The user can not
change the value of the id because the field is not selectable and I
was able to reproduce the error on th user machine (which I have right
now). This behavior seems kind of odd since the value of the field is
null and the code worked OK in the two previous versions of Access
(even on Access 2000 I've used the same technique without trouble). I
will try checking for me.NewRecord and see if I can work around this
limitation. Any thoughts on what might be causing this problem?

PS

This was my first experience with Access 2007 and I have to say that
it looks pretty. The new arrangements of buttons took a couple of
minutes to get used to but in all it looks that it was an
improvement. I haven't tried the rich text property of memo fields
but am eager to do it since so many people ask for it and I really
like to stylize text (at least create lists of items). One thing I
didn't like as much was the database container window. I used
Northwind to browse the new functions and I had a really tough time
finding just the tables (I haven't been able to see all the tables yet
although I think I know how to do it now). The new embedded macros
weren't that friendly since there were no comments and actions weren't
easily recognized (although the same can be said about code, specially
those that deal with API's). The tabbed views were really good as
each window was readily accessible from a tab and not covered by a
window.

Thanks

Jesse
 
Top