OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Refresh a table control

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
geleto
Newbie
Newbie


Joined: 08 Sep 2009
Posts: 3

PostPosted: Tue Sep 08, 2009 7:58 am    Post subject: Refresh a table control Reply with quote

Hi,
I am having a form with a table control and a few text boxes inside a subform. The table control uses a query as a content source. I want to update the table/query whenever a text box changes.
To do this I created a macro that I call from the "After updating" event

First I locate the main form:
Code:
dim mainForm
mainForm = oEv.source.parent.parent

Then I find the table:
Code:
dim table
table = mainForm.GetByName("TasksQuerryControl")

Calling table.Refresh() does not work - "BASIC runtime error. Property or method not found"
Calling mainForm.Reload() restores the textbox to it's old value (before the update).

What am I missing?
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Tue Sep 08, 2009 10:03 am    Post subject: Reply with quote

The table control is not bound to anything thus there is nothing to refresh/update from.
A table control bundles bound controls (text/list/date/combo/numeric boxes) in columns so you see more records than just the active record.
Each row within a field is another instance of the same bound control model.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
geleto
Newbie
Newbie


Joined: 08 Sep 2009
Posts: 3

PostPosted: Tue Sep 08, 2009 10:15 am    Post subject: Reply with quote

So what is the correct way to refresh the form/table query?
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Tue Sep 08, 2009 10:28 am    Post subject: Reply with quote

I don't know. You may refresh the form or each of the table control's columns but certainly not the table control. Browse the object hierarchy.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
geleto
Newbie
Newbie


Joined: 08 Sep 2009
Posts: 3

PostPosted: Tue Sep 08, 2009 12:21 pm    Post subject: Reply with quote

Villeroy wrote:
Browse the object hierarchy.
Is there a way to browse the object hierarchy? The closest thing I find is the Form Navigator.

Villeroy wrote:
You may refresh the form
Reoad()ing the form cancels the changes in the text control. Is this a bug? The reloading happens in the "After modify" event and by that time the change should have been saved.

Villeroy wrote:
...or each of the table control's columns
I tried to refresh a column:
Code:
table.GetByName("Name").Refresh() 
and it's not working (method not found).

IMO all forms and controls should have a Refresh method which they should pass to their children.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Tue Sep 08, 2009 12:47 pm    Post subject: Reply with quote

install mri or xray
:roll:
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group