Setting ControlSource to Sum shows Error

troman

New member
Local time
Today, 14:19
Joined
Jan 3, 2007
Messages
3
Hi,

In my application I have continuous form with unbound textbox. In OnOpen form event I change ControlSource property of textbox to one of the fields (e.g. "Kol921") in forms recordset. In form footer I have another unbound texbox where I defined ControlSource property as "=Sum([Kol921])".
Values in fields shows correctly, but in "sum" textbox I get Error.

When I get through code in debugging mode (with F8 key), value in "sum" texbox shows correctly, but when I open form normally I get an Error in that textbox.

Here is part of code:
Me.Controls("mat1").ControlSource = "Kol921"
Me.Controls("mat1").Visible = True
Me.Controls("matSum1").ControlSource = "=Sum([Kol921])"
Me.Controls("matSum1").Visible = True

Thank you for any suggestions how to solve this.
 
Welcome to the forum !

What you are trying to do ?
Your approach sound as a wrong setup at tables level.
 
Hi,
I am creating a table from VBA. Then I'm populating table with data. Finally I'm showing it in continuous form and in form footer section show summarized data.
Interesting is that when I'm open form step by step through VBA code, summarized data shows normally. But when I'm open the form without steping through code I get error in "sum" textboxes.
 

Users who are viewing this thread

Back
Top Bottom