modify an existing field

G

Guest

I have a field called grosswt(it is in tons). Currently it is a field that
the user puts into a Form based off of a query.(which obviously is based off
a table). I have about 7 different reports all based off of different
queries but the same table.

On an INPUT form- I need to modify the gross weight field that if we are
given lbs then take the pound amount and divide it by 2000 to get the
grosswt(in tons). I really do not want to change the grosswt field at all
since there are so many reports and queries that use this field. I would
have to modify 6-8 queries and hope I get them all. Is there anyway I can
handle is pound(lb) situation and leave the grosswt. field in tact.

Thought of If then where if pound field is 0 grossweight = grossweight
If pound field not null than grosswt=lb/2000
If I do this then I will have to change all the queries

Thanks,
Barb
 
G

Guest

If you are saying that you have one control on your form that the user can
input the weight either in tons or pound, but you want it stored in the table
as pounds, then I would suggest you put a small command button on the form
just to the right of the grosswt text box that will do the conversion for
you. In the click event:

Me.grosswt = me.grosswt / 2000

For safety sake, I would disable the button for existing records and only
enable it for new records. Do that in the form Current event:

Me.cmdConvert.Enabled = Me.NewRecord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top