Ask Your Question
0

Base form auto enter zero field value?

asked 2019-01-10 20:42:23 +0100

RichardZR gravatar image

Can I have a base form auto enter a field with zero value when advancing to a new record? I am doing accumulate function on a couple of table fields and it hates to see null! I would like not to have to always enter a zero when I'm not entering another value.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-01-10 21:33:58 +0100

Ratslinger gravatar image

updated 2019-01-10 21:57:02 +0100

Hello,

Yes. How you accomplish this is dependent upon the field type. If numeric, you should be able to set a default value in the fields' property when editing the table. If a text field you may need to Alter the database field:

ALTER TABLE "YOUR_TABLE_NAME" ALTER COLUMN "YOUR_FIELD_NAME" SET DEFAULT 0

This is executed form opening Base screen menu selection Tools->SQL....

For related information see -> Macro for default date equal Today and the related links within my answer.

Edit:

You can also update existing field using:

UPDATE "YOUR_TABLE_NAME" SET "YOUR_FIELD" = COALESCE("YOUR_FIELD", 0)
edit flag offensive delete link more

Comments

Excellent! Thanks much!

RichardZR gravatar imageRichardZR ( 2019-01-10 22:30:04 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-01-10 20:42:23 +0100

Seen: 25 times

Last updated: Jan 10