By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,509 Members | 1,710 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,509 IT Pros & Developers. It's quick & easy.

When converting access 2000 --> 97 my addnew wont work

P: 18
Hi i Know this looks weird by i done a database in 2000 all worked well than i had to convert it to 97. I had to redo all my code that was fine but i can not get the form to addnew when OnOpen runs just won`t except it

In access 2000 all i needed was recordset.addnew how do you do this in 97 ???

Thankyou for any help
Jan 2 '07 #1
Share this Question
Share on Google+
10 Replies


NeoPa
Expert Mod 15k+
P: 31,186
What library are you using for Access 97.
Have you checked that it's Reference has been added in the VBA window?
Jan 3 '07 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Hi i Know this looks weird by i done a database in 2000 all worked well than i had to convert it to 97. I had to redo all my code that was fine but i can not get the form to addnew when OnOpen runs just won`t except it

In access 2000 all i needed was recordset.addnew how do you do this in 97 ???

Thankyou for any help
You shouldn't have had to redo all your code. How did you do the converstion. The way to do it is while in 2000 convert to previous version. Then open in '97 and allow it to convert to current version. Then you should open the vba editor and compile the code and as Ade (NeoPa) says you should check that there are no missing libraries from the library list.

Mary
Jan 3 '07 #3

P: 18
My code is there but does not seem compatable with 97
Eg. this error, run time error '424':
Object Required

[code]
Private Sub Form_Open(Cancel As Integer)
Recordset.AddNew
End Sub
[code]

I Have Found 1 (Microsoft Access 10.0 Object Library) missing which won`t let me put it in because name conflicts with existing module,project,or object library.
There is one older version (Microsoft Access 8.0 Object Library)
how do i fix it??
Jan 3 '07 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
My code is there but does not seem compatable with 97
Eg. this error, run time error '424':
Object Required

[code]
Private Sub Form_Open(Cancel As Integer)
Recordset.AddNew
End Sub
[code]

I Have Found 1 (Microsoft Access 10.0 Object Library) missing which won`t let me put it in because name conflicts with existing module,project,or object library.
There is one older version (Microsoft Access 8.0 Object Library)
how do i fix it??
You need to replace the Microsoft Access 10.0 with the 8.0 library. Just unclick the 10.0 and tick the 8.0 instead. This should solve the problems with incompatible code.

Mary
Jan 3 '07 #5

P: 18
there is only 1 of the objects library in 97(ver 8) or 2000 (ver 10.0)
I can`t untick either--> Error (Microsoft Access Needs this reference in order to work properly)
I can not install the one missing won`t let me even tryed replacing and renaming the files but did not work only played up and said file was missing.

the main errors are
1. Compile Error :
Method or Data member not found
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo33_AfterUpdate()
  2.    Dim rs As Object
  3.     Set rs = Me.Recordset.Clone  --------------------------Gives Error
  4.     rs.FindFirst "[ID] = " & Str(Nz(Me![Combo33], 0))
  5.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  6. End Sub
I have fixed error about OnOpen recordset.addnew

I had to do this seems to work so far
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     If Dirty Then
  3.         Recordset.AddNew
  4.     End If
  5. End Sub
Jan 3 '07 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
You are only going to continue to have problems unless you can get the correct library working.

My best suggestion is to create a new '97 database and import all objects. Hopefully this will solve the problem.

Mary
Jan 3 '07 #7

NeoPa
Expert Mod 15k+
P: 31,186
there is only 1 of the objects library in 97(ver 8) or 2000 (ver 10.0)
I can`t untick either--> Error (Microsoft Access Needs this reference in order to work properly)
I can not install the one missing won`t let me even tryed replacing and renaming the files but did not work only played up and said file was missing.

the main errors are
1. Compile Error :
Method or Data member not found
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo33_AfterUpdate()
  2.    Dim rs As Object
  3.     Set rs = Me.Recordset.Clone  --------------------------Gives Error
  4.     rs.FindFirst "[ID] = " & Str(Nz(Me![Combo33], 0))
  5.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  6. End Sub
I have fixed error about OnOpen recordset.addnew

I had to do this seems to work so far
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     If Dirty Then
  3.         Recordset.AddNew
  4.     End If
  5. End Sub
I've updated the code tags on your post.
This enabled me to see more clearly what was missed before :-
Expand|Select|Wrap|Line Numbers
  1.     Set rs = Me.Recordset.Clone  --------------------------Gives Error
  2. should be :
  3.     Set rs = Me.RecordsetClone  <--------Probably doesn't any more :)
The Clone object doesn't exist as an attribute of Recordset but the RecordsetClone object is an attribute of the Me object.
Your other code will still have problems but let's deal with them singly to avoid complications...
Jan 3 '07 #8

NeoPa
Expert Mod 15k+
P: 31,186
BTW Another problem with the question was that you implied this was a port from one version to another.
Naturally we looked there for the problem.
However, this code never ran correctly anywhere. This is a very different problem from that which we we searching for.

Please don't see this as criticism (I also know you tried to get the code tags to work on your own) but as an illustration, for yourself and others, of how important the phrasing of a question really is.
Jan 3 '07 #9

P: 18
BTW Another problem with the question was that you implied this was a port from one version to another.
Naturally we looked there for the problem.
However, this code never ran correctly anywhere. This is a very different problem from that which we we searching for.

Please don't see this as criticism (I also know you tried to get the code tags to work on your own) but as an illustration, for yourself and others, of how important the phrasing of a question really is.
I don`t see this as criticisim only help

The
Expand|Select|Wrap|Line Numbers
  1. Set rs = Me.RecordsetClone
that Fixed the problem thank you.

But

Do you mean this code never worked
Expand|Select|Wrap|Line Numbers
  1.  Set rs = Me.Recordset.Clone 
the reason i ask is that this code is in my other database (2000 Access) and it has no problem??
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo9_AfterUpdate()
  2.  
  3.     Dim rs As Object
  4.  
  5.     Set rs = Me.Recordset.Clone
  6.     rs.FindFirst "[Supplier & Product ID] = " & str(Nz(Me![Combo9], 0))
  7.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  8. End Sub
  9.  
The only problem i have is recordset.addnew how is this done in 97 becouse i can get it to work fine in 2000 in another data base but it won`t accept this in 97
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. Recordset.AddNew
  3. End Sub
  4.  
Jan 9 '07 #10

NeoPa
Expert Mod 15k+
P: 31,186
But

Do you mean this code never worked
Expand|Select|Wrap|Line Numbers
  1.  Set rs = Me.Recordset.Clone 
the reason i ask is that this code is in my other database (2000 Access) and it has no problem??
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo9_AfterUpdate()
  2.  
  3.     Dim rs As Object
  4.  
  5.     Set rs = Me.Recordset.Clone
  6.     rs.FindFirst "[Supplier & Product ID] = " & str(Nz(Me![Combo9], 0))
  7.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  8. End Sub
That's what I meant.
Maybe my testing was inadequate. You sound as if you know what you're talking about. It was probably a Method (Procedure) rather than a property (data) though.
Jan 9 '07 #11

Post your reply

Sign in to post your reply or Sign up for a free account.