Base form not displaying default text

Creating and using forms
Post Reply
MikeG123
Posts: 8
Joined: Sat Aug 16, 2014 11:32 am

Base form not displaying default text

Post by MikeG123 »

Hi
I have a form for payslips where I have entered default text for a number of fields e.g. Base Salary field default is $2239.40, as shown in the second attachment below. But when I exit design mode the default text fails to show up giving me a '0' instead, as per the first attachment. It was all working fine until I changed the field type in the table from text field (string) to numeric field (decimal).
What am I doing wrong?
Mike
Attachments
Form design mode off.PNG
Form in design mode.PNG
OpenOffice 4 Windows 8
Arineckaig
Volunteer
Posts: 828
Joined: Fri Nov 30, 2007 10:58 am
Location: Scotland

Re: Base form not displaying default text

Post by Arineckaig »

a form for payslips where I have entered default text for a number of fields e.g. Base Salary field default is $2239.40
I am sorry that you have not yet had a reply.

Default entries can raise issues for a number of reasons: typically a mismatch of datatypes between a form and database table.

Screen dumps, however, seldom help to track down the source of error(s). It would be more helpful to post a copy of the database: preferably with token data but certainly after removing from its tables anything confidential or sensitive. If the database is remote, such as MySQL, simply copy and paste the table definition and the form document to a newly created embedded Base file, and post a copy of that token file.
When this issue has been resolved, it would help other users of the forum if you add the word - [Solved] - to the Subject line of your 1st post (edit button top right).
AOOo 4.1.5 & LO 6 on MS Windows 10 MySQL and HSQLDB
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Base form not displaying default text

Post by Villeroy »

On database level, the default value will be inserted when a new record is going to be stored and the field value is missing. The form won't show any field values that may be stored by the underlying database engine at a later point of time.
On form level, you can define a default value for the respective form control. It will be displayed on the form. however, in order to save the new record the record needs to be edited one way or the other. The default values do not modify the form so the save buttons remain disabled.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply