AllowAdditions = True in Access 2010 vs 2003 (1 Viewer)

nschroeder

nschroeder
Local time
Today, 07:51
Joined
Jan 8, 2007
Messages
186
We will be converting our employees from Office 2003 to 2010 over the next weeks, and I currently have both on my PC. In one of my applications, many of the forms set set various various property values in the Load event based on the user type. Setting the AllowAdditions property to true does not appear to work in 2010. AllowEdits works fine. Any ideas of why, or what to do about it?

Code:
Private Sub Form_Load()
    If MyUserType() = "Admin" Then
        Me.AllowEdits = True
        Me.AllowAdditions = True
    End If
End
Sub
 

spikepl

Eledittingent Beliped
Local time
Today, 14:51
Joined
Nov 3, 2010
Messages
6,142
I seemingly do not know what "does not appear to work" means.:confused:

The "Not working" conveys absolutely 0 useful information.

Be specific - you do something (what?) and expect something (what exactly?) but get something else (what exactly?).
 

nschroeder

nschroeder
Local time
Today, 07:51
Joined
Jan 8, 2007
Messages
186
Sorry. The "New Record" button on the VCR control remains disabled in 2010. When I run it in 2003, it becomes enabled. I stepped through the debugger, and it does set the property to True, but I still can't add records.
 

nschroeder

nschroeder
Local time
Today, 07:51
Joined
Jan 8, 2007
Messages
186
Having heard no suggestions, I took a different approach and set the AllowEdits and AllowAdditions properties both to True in the form, rather than in the Load event. I am still unable to either add or edit records. I double-checked the record source value by pasting it into a query, and I was able to both add and edit records in the query, so it seems to be a problem with the form itself. Other than the above properties, what would prevent adding/editing records on an Access 2010 form that works fine in 2003?

BTW, I narrowed it down to this particular form. Others work.
 

spikepl

Eledittingent Beliped
Local time
Today, 14:51
Joined
Nov 3, 2010
Messages
6,142
AllowEdits works fine.
prevent adding/editing records on an Access 2010 form that works fine in 2003?
So which is it: both adding and editing, or adding only? If you try to edit in 2010 what is the reaction of the system? Messages or does the edit execute OK?

Off-hand nothing springs to mind (mine, that is; other minds can have different ideas) other than ado/dao declarations and their sequence - this may or may not be relevant.

Suggest you gut your db down to the problematic form only, and post it in the working 2003 and nonworking 2010 versions, so someone with 2010 can have a look.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 13:51
Joined
Sep 12, 2006
Messages
15,708
it might be the Admin user you are testing.

A2010 no longer has user defined security - so "admin" may or may not be respected. it may depend on whether you are using A2003 format, or A2010 format.

i would put a breakpoint in, and examine the code arounfd the form open event.
 

boblarson

Smeghead
Local time
Today, 05:51
Joined
Jan 12, 2001
Messages
32,059
Are you CONVERTING this file to the newer file format or are you just using it, as is, from 2010 (still in the 2003 file format)?

My suggestion, when going to 2010 from 2003 is to Create a new database shell (you can still create the 2002-2003 file format - MDB file if you want) and then IMPORT everything into it. That seems to be the only sure fire way to keep problems to a minimum when going to 2010 from 2003.
 

nschroeder

nschroeder
Local time
Today, 07:51
Joined
Jan 8, 2007
Messages
186
Thank you all for your replies.

Spikepel: I can neither add nor edit. I had originally thought I could edit.

Gemma: There is no security in place for this db. Accessibility is controlled at the folder level.

Bob: I did not convert it. It's still an mdb file.

I will try your suggestions of importing to a new db, and narrowing it down to to this form & table if necessary. Can someone tell me what the advantages are (if any) of converting the .mdb to .accdb?

Thanks again!
 

boblarson

Smeghead
Local time
Today, 05:51
Joined
Jan 12, 2001
Messages
32,059
I would first just import into a new MDB file. The ACCDB file format is fine and you can have other features that aren't available in the MDB file format but just to see if this helps I would do it as an MDB first. Don't introduce new stuff at the same time.

You can convert it to ACCDB later.
 

nschroeder

nschroeder
Local time
Today, 07:51
Joined
Jan 8, 2007
Messages
186
I have attached a stripped down version of the db. I modified the Users form to have AllowEdits, AllowAdditions, and AllowDeletes to all = Yes, and I commented out the events code, but it still won't allow edits, deletions, or additions. I also imported my full db into a new one and that didn't help either. I'm sure I'm overlooking something obvious, so if someone can point it out, it would be greatly appreciated.
 

Attachments

  • TestDB.mdb
    392 KB · Views: 99

spikepl

Eledittingent Beliped
Local time
Today, 14:51
Joined
Nov 3, 2010
Messages
6,142
Errr : the attached is then supposed to work as is, but a 2010 version of it not? Or how exactly? I DL'ed it and can change/add values in the only form there is (I have 2007)
 

boblarson

Smeghead
Local time
Today, 05:51
Joined
Jan 12, 2001
Messages
32,059
Okay, that's strange. I just opened it up and it works fine for me in 2007 (gotta wait until I get home to test in 2010). If someone else has 2010 and can try that would be great. Otherwise I will let you know later when I get home.
 

nschroeder

nschroeder
Local time
Today, 07:51
Joined
Jan 8, 2007
Messages
186
Thanks for the effort. I opened the one in the attachment above and it does not allow me to add, update, or delete records in the Users form.
 

nschroeder

nschroeder
Local time
Today, 07:51
Joined
Jan 8, 2007
Messages
186
I just thought I'd check & see if anyone has had a chance to try the attachment in 2010? I would appreciate it.
 

boblarson

Smeghead
Local time
Today, 05:51
Joined
Jan 12, 2001
Messages
32,059
I apologize, I got distracted last night due to it being Halloween. I set a reminder on my phone just now so hopefully I'll remember tonight.
 

boblarson

Smeghead
Local time
Today, 05:51
Joined
Jan 12, 2001
Messages
32,059
Your problem is the record source. You have a query in there that shouldn't be there. And then you have the cost center table in that query (qryEmpShortNames).

So, not sure how it would work in 2003 but you are doing stuff you shouldn't be doing (using multiple tables, especially from a one to many) in the same form's record source for editing, adding, deleting. You should be using a SUBFORM for that.

EDIT: Access 2007 tightened up some stuff that should have been in previous versions and Access 2010 took it a bit further.
 
Last edited:

nschroeder

nschroeder
Local time
Today, 07:51
Joined
Jan 8, 2007
Messages
186
Thanks Bob. I had the query in there as the record source to pull in values for other purposes, but it wasn't needed for the actual record source, so I switched it back to the Users table and got my other values elsewhere. Strange that it worked in both 2003 and 2007 though.

Thanks again.
 

Users who are viewing this thread

Top Bottom