Creating a value based on entry of another field and vice versa

jam

Registered User.
Local time
Today, 17:44
Joined
May 14, 2009
Messages
42
Hello everyone.

Sorry this is probably a real nooob post but please bare with me. I was trained many moons ago in Access V2 yes V2 on floppy disk. Since then I haven't used Access at all. However my boss has got wind of me being trained in access and has given me a project to complete.

Onto the problem...

I have 2 fields on the same form from the same table A=Acres B=Sq Feet
I need the system to automatically work out Acres based on sq feet and vice versa on the form rather than the table.

Some of our data will be in sq feet and I'd like it work out the area in Acres automatically, likewise we may get the details in Acres and I want to know what it'll be in square feet. Now I can get the actual equation very easily however I tried the expression building on the on click/on enter/on update and none of them work.

I honestly have no clue what to do and how to do it. Any help would be very appreciated.

Many thanks
jam
 
put two more textbox controls on your form. in one, put the equation to convert acre to sq ft, referencing the acre textbox. and then the fourth textbox put the equation to convert sq ft to acre.

these extra textboxes ought to be unbound (i.e., put a new textbox control onto the form and don't make the record or row source anything.) from memory, the equation goes into the "control source" property.

so, if i have two textboxes, one is txtAcres and the other is txtSqFt, i would make these texboxes: txtConvToSqFt and txtConvToAcres. then each has respective equations in it (you can usually just type these in design view straight into the control itself on the form)

txtConvToSqFt
Code:
=[txtAcres]*43560
txtConvToAcres
Code:
=[txtSqFt]/43560

alternatively, if you base your form on a QUERY you can have these equations in the query itself, then the form would have two boxes BOUND to each of those calculated query fields.
 
Thanks very much for that. I did find a work around by using a macro and on click. But your solution sounds much better than having to use a macro.

Now I have a problem with the Acres box not giving me decimal places so I'm onto that problem now.

Thanks very much for you input :)
 
Now I have a problem with the Acres box not giving me decimal places so I'm onto that problem now.

i think you need to make the property of the textbox : format "fixed"...
 
Got it to do the decimal places but it keeps rounding up. :mad: Access V2 was so much easier than 2003 :D
 
Solved. Changed to Fixed format single field size and auto decimal places in the table itself.

jam
 
glad you got it solved - and thanks for posting your solution, i'm sure it will help many a frustrated access user!
 

Users who are viewing this thread

Back
Top Bottom