Continuous forms

N

Nick T

Hi,
Got a form which the default view is set to 'continous forms'. this form
gets its data from a query and needs to be displayed like this.
I have 2 fields on the form which the data is provided by the query - these
being 'Actual weight' and 'Target Weight' (this data appears in text boxes).
I have a 3rd text box, which i want to apply a calculation to such as
'Target Weight' minus 'Actual Weight'. This will give me the difference
between the two.
However, if i add this to any command on the form, such as:

Eg,
On open,
Me.Difference = Me.Target - Me.Actual

The code works, and gives me the right answer to this calculation, however
because it is a continous form, the 'first' records calculation answer is
detailed in every text box labelled 'Difference' (even though they are on
different records on the form). Any suggestions anyone??

Thanks
 
N

Nick T

Hi,
Can you elaborate a little (beginner here)!

If i go to the desigh view of my query, where would i put this calculation??
In a new Column??
In what row??

Hope to hear back.

Thanks
 
M

Mr. B

Nick T,

Sorry. I just didn't think about that.

Yes, in a new column put something like:

WeightDiff: ['Target weight] - [Actual Weight]

HTH
Mr. B
askdoctoraccess dot com
 
C

Clifford Bass

Hi Nick,

Create an unbound text box on your form and set its Control Source
property to:

=[Target] - [Actual]

If either field can be null you could do something like this:

=IIf(IsNull([Target]) or IsNull([Actual]), "Unknown", [Target] - [Actual])

Hope that helps,

Clifford Bass
 

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

Similar Threads

continuous forms 3
Subform and Main From calucation 14
Calculation Trouble 10
data input via a comms port 6
text box code 3
automatically omit certain records 2
OnDirty Not Firing 4
Converting Weight - Lbs to Tons 5

Top