Unanswered: How do I change a textbox's control source while a form is open?
I have a Form CenterStock on which I have an unbound textbox "Text6". I need to change its control source based on the value of the field Supply (which is bound to the field Supply)
The Code for the control source (With Nz(DSum...)) worked when I had two separate textboxes (by putting it in directly in th control source property in design view mode of the 2 boxes), but its not working when I put this in my form's OnCurrent event.
Private Sub Form_Current()
If Me!Supply.Value = 1 Then
Text6.ControlSource = Nz(DSum("[QtySupplied]", "CenterIndentSupplyQuantity2", "[SupplyID]= Forms!CenterStock!SupplyID"), 0)