not sure what to do about this, can anyone help

dxp

Registered User.
Local time
Today, 07:03
Joined
Jun 5, 2006
Messages
62
I have converted my 2000 mdb file to a 2002 mde file. When I run the mde on another pc using 2003 In ' get #name? ' error on a control (Age) that holds a persons age calcultated from a DOB control ( DOB) which is populated from a popup calendar.

The age is calculated using the following

=Int(DateDiff("d",[DOB],Date())/365.25)

It all semms to work in my copy on my pc, why would it now fail? is it a referencing thing perhaps, Can anyone help:confused:

thanks
 
An MDE file compiled in Access 2002 will not work on a machine with Access 2003. The compiled MDE includes objects related to the specific version of Access that was used to generate it.
 
thanks ByteMyser, so the answer is to use an mdb file or buy 2003 or 2007, is that what you advise?
 
Here's a better Age() function for you:
Code:
Public Function Age(DOB As Date) As Integer

Age = DateDiff("yyyy", DOB, Date) + (Date < DateSerial(Year(Date), Month(DOB), Day(DOB)))

End Function
...and you may want to look into late binding.
 
dxp said:
thanks ByteMyser, so the answer is to use an mdb file or buy 2003 or 2007, is that what you advise?
What I advise, if you are going to use an MDE file, is to make certain that the version of Access on the machine on which it is to be run is the same version that is used to compile it from the original MDB file. If you are running it in Access 2003, compile it with 2003. If you are running it in Access 2007, compile it with 2007.
 
thanks Rural, function done, query done, how do i reference the query (qryCalcAge) in the txt box (Age) on my form? bound or unbound. It was bound before... thanks for your help once again.
 
I would display the age in the Current event of the "bound" form.
Me.YourAgeControl = Age([DOB])
Have you fixed the reference problems?
 
Hi RuralGuy, thanks for the help but you've lost me now. The deeper I go into Acces the harder it gets to understand. Can you explain this binding thing in relation to the problem I am having. I have read your link and I am trying to get my head round it, why would a simple piece of code like I had in my copy for calculation of age from DOB running under 2002 not work in another version 2003 and why do I have to change it to a function and get involved with binding? not having a go, just trying to understand and remember I make dentures for a living, so in simple terms please...!!:) thanks
 

Users who are viewing this thread

Back
Top Bottom