Access

B

Buddy

Hi

I'm trying to find out how make this work.?
I have a shop that make hand rail for apartments, I making a program in
access that I can type in the length of rail I need and it will add up the
( weight, price per foot, and how much metal need ) I understand about
tables and forms but I think this is where Queries come in ( yes I'm new at
this) but I learn fast.? I just need a little understanding what I need to
know and do

any help would help
 
N

Niklas Östergren

Just a simple Q!

Are you storing some data reguarding this or do you just nee help from the
program to calculate how much material needed and the price for this?

Because if so then I think this is better to use Excell than Access. It´s
much more sutibable and easier to use than to learn Access for a task like
this.

Now maby you want to use Access for some other reason or I havn´t understud
your problem quit.

// Niklas
 
B

Buddy

Yes I'm storing data in this
maybe this will help to understand. let say I have a rail that's 12'(foot)
long, Top of the rail is 12' long 1 1/2" x 1 1/2" square tubing and bottom
rail is 12' long 1 1/2" x 1 1/2" square tubing and the 1 1/2" x 1 1/2"
square tubing weight is .605 lb. per foot. I have a table in my database
that has my tubing size in one field1 and the weight in field2. I made a
form that I can type in the lenght I need, I like it to add up the weight of
the top rail and the bottom rail ( top and bottom rail 24' (foot) times .605
= 1452 lb..
I have made this in excel it does work good in excel but I like to try
access
Thank you for your reply
 
N

Niklas Östergren

Hi Buddy!

This is quit simple. You allready have all data needed to make the
calculation stored so you dont need to store the result since you can
calculate it everytime you need it.

I guess that you have a combobox control in your form which you look up the
tube size? If not this might be a good idea and naming the combobox
something like cboTubeSize. If you use the wizard when creating the combobox
make sure you selecte the third option if so it will automaticly look up the
correct value for the weight (in control txtWeight on the form).

To be abel to do this you need to have a primary key (a unique key) in your
tabel with the tube size and weight. So each size get´s it´s own unique
value which access can look up and get value for in field with the weight
and size.

Then create 5 unbound textcontrols on your form:

txtTopRailLength
txtBottomLengtRail
txtWeightOfTopRail
txtWeightOfBottomRail
txtTotalWeight

Set controlsource for each of them to following (only the text after the =
sign):

txtTopRailLength = (this one should not have any controlsource)
txtBottomLengtRail = (this one should not have any
controlsource)
txtWeightOfTopRail = ([txtTopRailLength]*[txtTubeWeight])
txtWeightOfBottomRail = ([txtBottomLengtRail]*[txtTubeWeight])
txtTotalWeight = [txtWeightOfTopRail]+[txtWeightOfBottomRail]

That´s it!

If you need to do this calculatione somewhere else, in reports for instance)
you do exactly the same. And as you will learn many things in Access can be
done in several ways, this was just one of them.

As you can see I use names on my controls so it´s easyer to know what
control or fields I´m refering to. So I suggest that you rename the fields
in your tabel to something meaningful instead of field1, field2. As long as
you only have a few fields and only one tabel you might remember which
fields is what kind of data. But if your db grows...

I hope this helps you out!?

// Niklas




So, cretae a control
 
Top