Connecting Tech Pros Worldwide Help | Site Map

Using custom controls in a continous form

Newbie
 
Join Date: Oct 2009
Posts: 3
#1: Oct 12 '09
I have an application that i am writing that uses a simple activex control that i built. the application is for inventory tracking and projections of future sales. i am using a continuous form to display all of the products at each location, and i wish to use my control to display the percentage of product in each tank. the problem is that when i pass the percentage value to my control, it displays the last read value from inventory in all of the controls regardless of what their value might be. so my question is, is there a way for me to pass the value to the control for each individual record and hold it while moving on to the next? the inventory field is bound, but the problem as i see it is that the control it self has the same name throughout the form, so it is just updating it to the most recent value. if anyone sees a way around this i would be grateful

thanks
Newbie
 
Join Date: Oct 2009
Posts: 3
#2: Oct 12 '09

re: Using custom controls in a continous form


An amendment here, actually it is reading only the first record, and ignoring the rest
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,714
#3: Oct 12 '09

re: Using custom controls in a continous form


A common problem. See Why Values in Unbound Form Controls do not Persist for the explanation.

You could try updating the RecordSource to include the extra value. Your ActiveX control could then be bound to this new value, thus reflecting the result of each record rather than reflecting the latest assigned as you'd expect from an unbound control.
Newbie
 
Join Date: Oct 2009
Posts: 3
#4: Oct 12 '09

re: Using custom controls in a continous form


Pardon my ignorance, but the inventory field is a bound field, and as you would expect is different for each commodity, and so i guess that i am going to have to figure out how to dynamically add these controls to the form each time it is updated so that i can get the values to reflect the associated record. if you could point me in the right direction there, i would be grateful. if not it looks like more googling for me. thanks
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,714
#5: Oct 12 '09

re: Using custom controls in a continous form


Is your ActiveX control bound directly to the Inventory field? Or is it trying to display a calculation based upon this? If the latter then it is not a bound field. To make it bound you need to do the calculation in the query, and bind the control to this value.
Reply