"Default" value using the Format Property

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,347
Office Version
  1. 365
Platform
  1. Windows
After reading through a chapter in my Access Dummies book, I leaned that you can put a default value in a Table field by using the format property. Being away from my book, I must be remembering the directions incorrectly or this does not work the same on an unbound field in a form as it does in a table. I though if you entered @;"Select...." in the format field that is what would show if the field was blank.

Am I doing this wrong or can this only be done in a table field.

The Form field is a Listbox - I do not want to make the default a part of the list the listbox uses.

Thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
After reading through a chapter in my Access Dummies book, I leaned that you can put a default value in a Table field by using the format property.
That doesn't sound quite correct to me.
There is a "Default Value" property that you would use to enter a default value for a table field. That is very different from the Format property, which I was pretty sure just designates the Format of the field, not the Default Value.

See here for setting default value for other objects: https://support.office.com/en-us/ar...controls-99508d03-b28b-4057-9652-dac1c4c60d86
 
Upvote 0
Actually you can do that in a Table Field. By entering >;;"Enter the RFP Number" in the format property of a Table, the text Enter the RFP Number will appear in the field until something else is entered. It works in Tables, wasn't sure if it would work in an unbound field on a Form - which currently I do not believe you can.

This is different than a Default. A default actual has a value in the field once a record is created. Using the Format function, the text "Enter the...." is never a value in the field.

Big day for me, I knew something Joe didn't - lol. I say that out of great respect for you. I have a long ways to go to catch up to you.
 
Upvote 0
Big day for me, I knew something Joe didn't
Well, not really (at least not in this case). As you said, this really isn't a default value, so what I said is correct, you cannot enter a default value through the Format property (and your question was regarding Default Values).

>;;"Enter the RFP Number"
All this really does is return a Custom Format in the event of null values (which is why there is no value).
Just like if you format a number for Currency, the dollar sign ($) isn't really part of the data, it is just part of the Format.
I have seen people do lots of clever things with Custom Formats.
For a detailed description on Custom Formats, see here: https://support.office.com/en-us/ar...rmatting-a5e5bcde-85da-4c7a-8164-1fe286636668

By the way, that other link I provided in my first post shows how you can provide default values to unbound fields. A way that I commonly use is VBA, and have it run on certain events (like the Loading of the Form).
 
Upvote 0

Forum statistics

Threads
1,221,710
Messages
6,161,445
Members
451,706
Latest member
SMB1982

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top