Newbie question about form calculations

TomUK

Registered User.
Local time
Today, 04:19
Joined
Dec 16, 2008
Messages
16
Hello,

I am in the process of creating an inspection database for a manufacturing company I work for.

The idea being to store a large amount of data currently stored in separate excel spreadsheets in a single access database, to enable easier queries of the data.

I am currently struggling with creating a data entry form for new inspection data.

Some of the data that is entered is run through a conversion factor and thus I am looking to include the conversion factor on the form and enter the converted data directly into the database.

I understand that this is bad practice, but as the historic data imported from excel has already been converted, I need to do the same with new data entered into the form.

My question is, can I setup a textbox which the original data is entered, converted and then saved to the table?


Thanks,


Tom
 
yes, you can do this. An easy way to do it is to have two text boxes, one bound to the field you want to save to and one unbound text box with the calculation as the control source. Then, in the AfterUpdate event of the one with the formula you would use:

Me.YourBoundTextBoxName = Me.YourUnBoundTextBoxName
 
Last edited:
Thanks for the quick reply.

I should have mentioned this before, but I am running 2003 and I cant find the recordsource you mentioned, is this the same as controlsource?
 
;)
Thanks for the quick reply.

I should have mentioned this before, but I am running 2003 and I cant find the recordsource you mentioned, is this the same as controlsource?

yes:D:p
 
Thanks for the quick reply.

I should have mentioned this before, but I am running 2003 and I cant find the recordsource you mentioned, is this the same as controlsource?

Yeah, sorry about that. I keep messing that one up (getting senile I guess).
 
I still can seem to make this work, it appears to be the control source in the unbound textbox that is the problem.

This is what I have writen in the contolSource:
=[Input force at 1.5mm]/[miscalanious values]![Number of bridges]

The name of my unbound textbox is Input force at 1.5mm and the value it is dividing it by is souced from a table called miscalanious values
 
I still can seem to make this work, it appears to be the control source in the unbound textbox that is the problem.

This is what I have writen in the contolSource:
=[Input force at 1.5mm]/[miscalanious values]![Number of bridges]

A couple of things -

1. You should not use special characters in field or object names (example: 1.5 the period) as that can cause you pain

2. You should not use spaces in field or object names as it simplifies things.

3. Your form would need to have [Number of bridges] in it's recordsource (yes this time I do mean recordsource). You can't refer to a table this way. You would need a DLookup to lookup a value that isn't in your recordsource.
 

Users who are viewing this thread

Back
Top Bottom