Connecting Tech Pros Worldwide Help | Site Map

Setting DefaultValue Property

Mark
Guest
 
Posts: n/a
#1: Nov 12 '05
How do I write the following code to set the default value?

Me!xNum.DefaultValue =
Me!XCurrency.DefaultValue =
Me!XDate.DefaultValue =
Me!XString.DefaultValue =

Can I just put all the lines of code in the Form's AfterUpdate event?

Thanks!

Mark


Allen Browne
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Setting DefaultValue Property


Yes, you can, but bear in mind that the DefaultValue property is a string:

Me!xNum.DefaultValue = """" & 999 & """"
Me.XDate.DefaultValue = """" & Format(Date, "Short Date") & """"
Me.XString.DefaultValue = """Type over this nonsense"""

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mark" <mmorrow@earthlink.net> wrote in message
news:EuHnc.591$zO3.461@newsread2.news.atl.earthlin k.net...[color=blue]
> How do I write the following code to set the default value?
>
> Me!xNum.DefaultValue =
> Me!XCurrency.DefaultValue =
> Me!XDate.DefaultValue =
> Me!XString.DefaultValue =
>
> Can I just put all the lines of code in the Form's AfterUpdate event?[/color]


Closed Thread