[Solved] Macro equivalent for Undo entry button

Creating and using forms
Post Reply
ponlerd
Posts: 56
Joined: Sun Nov 15, 2009 6:22 pm
Location: Bangkok, Thailand

[Solved] Macro equivalent for Undo entry button

Post by ponlerd »

Hi, is there a macro command that is equal to pressing the "Undo Data Entry" button on the form navigation bar??
Thanks a lot!!
Ponlerd
Last edited by ponlerd on Tue Mar 23, 2010 12:24 pm, edited 1 time in total.
OOo 3.2 Ubuntu 9.04 / OOo 3.2 Windows7 / Migrating from Access
RPG
Volunteer
Posts: 2250
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Macro equivalent for Undo entry button

Post by RPG »

Hello

Use a standard button and adjust the properties as you need. It acts only the form/subform where the button is.

http://user.services.openoffice.org/en/ ... 83&t=28235

Romke
LibreOffice 7.1.4.2 on openSUSE Leap 15.2
ponlerd
Posts: 56
Joined: Sun Nov 15, 2009 6:22 pm
Location: Bangkok, Thailand

Re: Macro equivalent for Undo entry button

Post by ponlerd »

Thank you for your super fast reply, but my problem is a bit more complicated.
Actually your solution will work, but is it possible to add some more action to the button, such as

General button action set to Undo
After the button is clicked, i want to be able to attach a macro after the undo was done.

I was planning to set the action of the button to None, and then write a macro attached to the Execute Action event like this.

sub XXX_ExecuteAction (Event as Object)

.... whatever command to undo

.... then other steps i want to do.
end sub

Now if i use the general action of the button, can i attach a macro to do the other steps that i want ??
Thank you so much for your help.
Ponlerd
OOo 3.2 Ubuntu 9.04 / OOo 3.2 Windows7 / Migrating from Access
RPG
Volunteer
Posts: 2250
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Macro equivalent for Undo entry button

Post by RPG »

Hello

I don't know if you can bind an action and an event to the same button but you can easy try it.

Start first with study how OOo-base is working before writing macros. When you start with macros, start with understanding the idea of services and interfaces. When you understand how it works then your code can be more easy. This is true for the SQL and macros.

You can bind all kind off subs to events of a form.

I think your are searching for:
oForm.refreshRow

http://api.openoffice.org/docs/common/r ... ltSet.html

Romke
LibreOffice 7.1.4.2 on openSUSE Leap 15.2
ponlerd
Posts: 56
Joined: Sun Nov 15, 2009 6:22 pm
Location: Bangkok, Thailand

Re: Macro equivalent for Undo entry button

Post by ponlerd »

Thank you so much !
That is it!
Form.RefreshRow()
OOo 3.2 Ubuntu 9.04 / OOo 3.2 Windows7 / Migrating from Access
User avatar
MTP
Volunteer
Posts: 1620
Joined: Mon Sep 10, 2012 7:31 pm
Location: Midwest USA

Re: [Solved] Macro equivalent for Undo entry button

Post by MTP »

Be careful - refreshrow() may act on multiple rows! I needed to only undo data entry on a single row - the solution here seems to work: [Solved] Cancel insert row
OpenOffice 4.1.1 on Windows 10, HSQLDB 1.8 split database
Post Reply