Shipping Calculations

ok I figured got that library added but i'm still getting the same message
"Name conflicts with existing module, project or object library"
 
ok so now when I try to compile I'm still getting the following message
"User-defined type not defined"

now in the help it says
"You can create your own data types in Visual Basic, but they must be defined first in a Type...End Type statement or in a properly registered object library or type library."

I thought the DAO library would solve the problem but it has not. So I'm wondering if this part of the code in the problem? Mind you I know nothing about VBA I have been getting help from these forums.

Function GetRate(lngProdID As Long, lngQty As Quantity) As Currency
 
Did you get the references right?

When you run the code (not Compile) and the error message comes up, click DEBUG and it will highlight a line. What line is that?
 
Yes i believe so I got the DAO reference added. and I compared it to the list on the website you gave me and made sure that they were the same Here is what is checked
I attached a image of it in a word doc but I had to zip it to get the size right.

When you run the code (not Compile)
It won't let me it just makes the dinging noise
and the error message comes up, click DEBUG and it will highlight a line. What line is that?
the message come up when I compile
Debug just ding

run brings up a macro screen

I have Access 2007
 

Attachments

ok when I try to compile the code the following line gets highlighted

Function GetRate(lngProdID As Long, lngQty As Quantity) As Currency
 
You've copied and pasted the code from somewhere and trying to amend it to your needs without understanding basic vba. You first of all need to understand the basics before trying to amend code.

The reason it went "ding" when you tried to compile again is because you didn't stop the code after it halted due to an error.

You can declare a variable as an Integer. If you knew what UDT's are then yes you can define a variable as a quantity but that doesn't apply in your case. Get the basics first.
 
yes this code is from earlier in the post page 1, I have been reading on the basics and I am trying to learn and the person who wrote this code posted an explination for the code so I kind of understand this specific code and like I said i'm trying to learn the basics
 
We can't provide you with basic vba via the forum because it would require self study. There are so many elements to understand. I can provide a link to a tutorial if you wish?

In the meantime, what is the current situation with the code?
 
Yes please if you know a good tutorial!

I don't know what happened now it says can't find file....

Boy oh boy is this frustrating.....
 
ok I fixed it! file is being found now Thank you for the link
 
No problemo! See how things go and before you know it I would be coming to you for vba advice :p :)
 
LOL no so sure about that! thanks again for the link... What version of access do you use I keep reading how access and VBA is so much easier in 2010
 
I've read the reviews and it's looking good. I have several versions of Access but my most latest version is 2007.
 
that is what I have I was just wondering If it would be easier to learn in 2010 that seems to be the selling point in some of the things I read and heard.... either way I still have to learn LOL
 
VBA is pretty much the same across all versions. The main difference is for newer versions of Access some methods/functions/properties are deprecated and some new ones are added.

It would be much easier to learn how to use Access in 2010 but it wouldn't make a difference when it comes to vba.
 
Ok well i think I have a pretty good basic understanding of Access... and if it isn't gonna help in learning vba then i'll just upgrade at a later date
 

Users who are viewing this thread

Back
Top Bottom