form quirks when altering controlsource

casey

Registered User.
Local time
Today, 11:52
Joined
Dec 5, 2000
Messages
448
I've been changing the contolsource property on several comboboxes on my form during run-time. It seems that whenever I do so, my form starta having quirky problems as numbers in other controls will disappear or become non-editable and other things. Has anyone had problems of this sort when using the controlsource property? Or is changing the controlsource property during run-time a bad idea?
 
Changing the controlsource of combo and list boxes on runtime works perfectly and is a necessity.
If there is any influence between these controls and others then you have installed some programmatical relationship (changing of the controlsource triggers an event that you have created).
So simply check which events exist for the controls which controlsource you modify.
 
Thanks for the response.
I've checked the modules that contain the controlsource property and no statements refer to any of the controls being adversely affected. It seems as though Access is changing these controls on it's own.
Here's what it's doing: I have a module that sets several comboboxes' controlsource to "". When a user selects a part the combobox's controlsource is set to "a query that shows the parts". Each combobox has another corresponding combobox that holds the quantity that the user wishes to add. The quantity comboboxes are defaulted to "1". (This may be coincidence, but) when any of the parts controls' controlsource property are changed, the corresponding quantity comboboxes (which are never even referred to) lose their values.
Sometimes the values in these quantity comboboxes will appear, but when I move the scroll bar up or down and the controls move off the screen, they will then disappear or contain a partial value(like a couple pixles of a 1).
This is a very wierd problem and it may be due to something I'm doing in the module. I merely hope that someone may have encountered this problem before when altering the controlsource property and could explain to me what's happening.
Thanks.
 
In addition:

I've stepped through the coding and everything runs properly up to the statement that manipulates the controlsource property(on a non-related control). Only after that statement runs do the other controls clear themselves out. So I'm quite sure that the changing of the controlsource property is directly having an effect on these other controls.
 

Users who are viewing this thread

Back
Top Bottom