Calculated Field - Move Next

  • Thread starter Thread starter Kim
  • Start date Start date
K

Kim

I'm using a calculated field...

eg. total = 8 (this field comes from a table)
converted = 12 (this field is calculated)

when I use the movenext the converted recalculates,
however the last record is blank and the converted does
not become blank, it remains converted = total * 1.5 from
the previous record

Any suggestions?
 
You really have not asked a question or given us any
indication as to what you're trying to do. Also, you
really do want to avoid creating any calculated fields in
your tables. Calculations are almost always confined to
controls only. Why take up space with calculated data
when you can just calculate them on the fly as needed?
Avoid having fields that have data that can be calculated.

Now, tell us what it is you're trying to do.
 
Sorry, I meant the text field is calculated, not the table
field. It brings in data from the table and calculates a
number to appear on the form which is a control on the
amount they can deduct from the original value from the
table.

So, when the user hits the move next this is the
programming

DoCmd.GoToRecord , , acPrevious
txtHoursAvailable = Me.Recordset!TotalHoursComp * 1.5

The problem is when the move next reaches the last record
in the query which is blank, even though the condition
says that TotalHoursComp > 0 it shows the blank record,
and the txtHoursAvailable field does not recalculate based
on a 0 or null value, it remains the same value it was on
the last record
eg. TotalHoursComp = 8
txtHoursAvailable = 12

DoCmd.GoToRecord , , acPrevious
txtHoursAvailable = Me.Recordset!TotalHoursComp * 1.5

The fields which are txtblah = recordset!blah
are blank but txtHoursAvailable remains 12
 
Back
Top