Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Database dao2535 issues

Status
Not open for further replies.
Nov 22, 2007
38
GB
Hello Everyone

I have a database that been convert from access 2.0 to access 97 and now converted to Acess 2002 - 2003. The database has thrown an error for dao2535, which i've removed from Tools, Reference and added the dao 3.6 but some code is still not working for example:

Code:
Sub fixminvalues()
Dim met As Recordset, mydb As Database

Set mydb = CurrentDb()
Set met = mydb.OpenRecordset("metals data")

met.MoveFirst

Do Until met.EOF
met.Edit
If met.param = "Cd" And met.Value < 0.005 Then met.Equiv = "<"
If met.param = "Cd" And met.Value >= 0.005 Then met.Equiv = "="
If met.param = "Cd" And met.Value < 0.01 Then met.Value = 0.01
If met.param <> "Cd" And met.Value < 0.015 Then met.Equiv = "<"
If met.param <> "Cd" And met.Value >= 0.015 Then met.Equiv = "="
If met.param <> "Cd" And met.Value < 0.02 Then met.Value = 0.02
met.Update
met.MoveNext

Loop

End Sub

I've just been given the database so haven't done any of the coding.

Any help greatfully received.

Ralph
 
some code is still not working
Please, define "not working" !
What happens ?
Any error message ?
Some line of code highlighted when in debug mode ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi

The code posted falls over on

Code:
if met.param

with an error message of Compile Error, Method or data member not found.

This happens when i try and compile the database.

I'm not sure if this is the main problem or because the database has been converted and this is one of many issues...

Hope this helps

Ralph
 
Are param and Value the names of field in [metals data] ?
If so, you may try this syntax:
Code:
If met!param = "Cd" And met![Value] < 0.005 Then met!Equiv = "<"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi

That works great - just need to go through the database and find them all now.

The only when I'm having a problem with at the moment is:

Code:
Dim mydb As Database, myt As Table

Any ideas?

Thanks

Ralph
 
Again, WHICH problem ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Apologies hit the submit button before I'd finished typing.

myt As Table seems to be causing the problem

Thank you for the help

Ralph
 
There is no Table object in DAO, but TableDef.
What does the code with myt ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi

The full code I'm trying to correct is:

Code:
Sub reset_system_month()

'   THIS ROUTINE SETS THE MONTH IN 'SYSTEM VALUES' TO THIS MONTH


Dim mydb As Database, myt As Table


Set mydb = CurrentDb()
Set myt = mydbOpenTable("system values")
myt.MoveFirst
myt.Edit
myt![c_month] = DatePart("M", Now)
myt.last_num = 0
myt.Update
myt.Close
mydb.Close


End Sub

Thanks

Ralph
 
I'd use an action query instead:
Code:
Sub reset_system_month()
DoCmd.RunSQL "UPDATE [system values] SET last_num=0,c_month=" & Month(Now)
End Sub

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top