| View previous topic :: View next topic |
| Author |
Message |
geleto Newbie

Joined: 08 Sep 2009 Posts: 3
|
Posted: Tue Sep 08, 2009 7:58 am Post subject: Refresh a table control |
|
|
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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Tue Sep 08, 2009 10:03 am Post subject: |
|
|
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 http://forum.openoffice.org |
|
| Back to top |
|
 |
geleto Newbie

Joined: 08 Sep 2009 Posts: 3
|
Posted: Tue Sep 08, 2009 10:15 am Post subject: |
|
|
| So what is the correct way to refresh the form/table query? |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Tue Sep 08, 2009 10:28 am Post subject: |
|
|
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 http://forum.openoffice.org |
|
| Back to top |
|
 |
geleto Newbie

Joined: 08 Sep 2009 Posts: 3
|
Posted: Tue Sep 08, 2009 12:21 pm Post subject: |
|
|
| 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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Tue Sep 08, 2009 12:47 pm Post subject: |
|
|
install mri or xray
:roll: _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
|