Push button, display error dialogue

Creating and using forms

Push button, display error dialogue

Postby dianamon » Fri Jun 17, 2016 11:17 am

Hello!

Pretty new to openoffice- But I'm trying my best on a simple form to add customers into a database.
Everything works fine as it is now- But my workmates will have to use it as well and they're not very computer savvy.
Is there a way for my Push Button to open a dialogue box after it Saves and opens a new record?
It would be great if it could open a dialogue stating 'Customer added to database' . Even better if it could pick up on a Duplicate error or information not completed.
Right now there's no 'Violation of Unique record' message if you try and enter a duplicate record via the push button...

Any help is very welcome! Struggling with this for a bit too long now..
open office 4.1.2 windows 10
dianamon
 
Posts: 3
Joined: Thu Jun 16, 2016 7:16 pm

Re: Push button, display error dialogue

Postby dianamon » Fri Jun 17, 2016 11:34 am

I managed to get a message to come up when a customer is added to the database.
(while waiting for the topic to be approved :shock: ) Found this code in another topic and tweaked it:
Code: Select all   Expand viewCollapse view
Sub helper
Const Helpheader="Added to Database"
Const Helptext= "You successfully added a new customer to the database!"
Const OKbuttonOnly=0

MsgBox Helptext, OKbuttonOnly, Helpheader

End Sub
]


The only problem is displaying the 'Violation of Unique record' message...
open office 4.1.2 windows 10
dianamon
 
Posts: 3
Joined: Thu Jun 16, 2016 7:16 pm

Re: Push button, display error dialogue

Postby UnklDonald418 » Sun Jun 19, 2016 10:46 pm

I suspect you haven't received any responses to your question because it is a little too vague for anyone to offer much help.
Right now there's no 'Violation of Unique record' message if you try and enter a duplicate record via the push button.

Code: Select all   Expand viewCollapse view
MsgBox ("Violation of Unique record",0,"Error")

can be used to display the message, but I'm guessing your problem involves trapping the error.
If that's the case perhaps if you uploaded a sample database file someone might be able to offer better help.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.6 & LibreOffice 6.1.5.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 1326
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Push button, display error dialogue

Postby Villeroy » Sun Jun 19, 2016 11:02 pm

Like so often, there is a way to do it if you leave behind the embedded HSQL1.8
https://forum.openoffice.org/en/forum/v ... ed#p331154
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28536
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Push button, display error dialogue

Postby dianamon » Mon Jun 20, 2016 11:16 pm

Thanks! I'll give it a go from the link you gave me.
The difficult part is that although everything in the database works fine right now, my workmates just don't understand openoffice at all... I'm trying to make it as user friendly as I can!
open office 4.1.2 windows 10
dianamon
 
Posts: 3
Joined: Thu Jun 16, 2016 7:16 pm


Return to Forms

Who is online

Users browsing this forum: No registered users and 1 guest