Try moving the formula to the query, still using the dlookup, add an index to
the table tblRmpsCoil for fields [CellNo] and [SeqNo], to have this working
use the query fields in the subform to feed the criteria in the dlookup

Signature
jl5000
<a href="http://joshdev.com"></a>
> Greetings
> I have a form and sunform and would like to calculate a control in the
[quoted text clipped - 59 lines]
>
> Scott
SteveS - 08 May 2005 21:18 GMT
> Try moving the formula to the query, still using the dlookup, add an index to
> the table tblRmpsCoil for fields [CellNo] and [SeqNo], to have this working
[quoted text clipped - 63 lines]
> >
> > Scott
Scott,
No, you are not doing anything wrong, but there is a better way.
If you look at the form in design view, there is one control (textbox) per
field that you want to display. If you have 10 records, then you see 10
values for each bound control. An unbound control will also be shown 10 times
for the 10 records, but since it has no control source, it shows the same
value in it (be it a constant or a calculation) 10 times.
Since you want to do error checking, put a user defined function (UDF) in a
standard module and pass the values from whatever query fields or form
controls needed and do the calculation/error checking in the function. The
values from a different table are needed, they can be retreived using a DAO
recordset.
The record source for the sub-form should be a query. In the query, add
something like:
calcRmpsCoilPara: MyCustomCalc([I],[some val])
where "MyCustomCalc" is the name of the UDF and two values are being passed
(in this example).
In the UDF, you can open a recordset (one or more) and use those values and
values passed to the function to do the calculations. (don't you just love
those custom functions???)
The last step is to bind the unbound control to the (query) field
"calcRmpsCoilPara" (without the quotes). Just think of queries as "virtual
tables".
All should be well with the universe......<g>
HTH
---
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
SteveS - 09 May 2005 00:22 GMT
Boy, I messed up on the previous post. Typed in Notepad and pasted without
really looking at where I was replying (using the web based interface at work
during lunch).
Sorry
---
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
Thanks for your help folks. Your comments were right on the money. Using the
query as a virtiual table is the ticket. I see how I can improve some other
things in my application. The Access light is getting brighter and the
\borland\corel\paradox light is getting dimmer. Maybe I'll even be able to
answer some questions soon.
Steve S I didnt see anything wrong with your post, It worked for me
Thanks again.
SteveS - 09 May 2005 16:57 GMT
> Thanks for your help folks. Your comments were right on the money. Using the
> query as a virtiual table is the ticket. I see how I can improve some other
[quoted text clipped - 5 lines]
>
> Thanks again.
I just meant that I was trying to get the reply done before my lunch break
was over; I meant to reply to your post, not jl5000's post.
> things in my application. The Access light is getting brighter and the
> \borland\corel\paradox light is getting dimmer.
Ditto with me, but I was in the Xbase arena... took a loooong time for the
event driven model to sink in.
;-)
---
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)