Base - List box not formatted as original field in associated table

Hi folks,

Im trying to create a small database for my brothers electrical business.

I have a list box that I inserted on a form. This list box is linked to a small
VAT table. In the VAT table, is a Vat_ID and a Vat_Rate. The Vat_Rate field
is set to numeric and formatted as a %.

However in the list box I cannot get it to appear as a percentage, ie 23% in
the Vat table appears as 0.23 in the list box. Can this be formatted to appears
as 23% in the list box?

Also, how do I set a default value in the list box for this field as
there is a default value for the Vat_Rate field set in the table?

Hello,

I get mixed and inconsistent results when it comes to the displayed value in a list or combo box. You can get a consistent display by changing the SQL for what is displayed:

image description

Two fields are created in the SQL. The displayed field first and the actual field second. The Bound field is the field actually stored within the record (field numbers relative to ‘0’).

Default values are another story. A default value in the table is deceiving. See How to change the default value of field in base? which discusses dates but actually related to all field defaults in a table ( see bug reported at end of my answer).

If you use a Valuelist in the listbox, one of the items in the list can be set as the default.

If you use SQL, you would need to use a macro to set which item was the default. In this case, if the table changes (such as the item was deleted) you may also need to change the macro.

Thank you for your response. That works well with the % sign. Im afraid Im new to macros so will have to look into that further.