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" <mm*****@earthlink.net> wrote in message
news:Eu***************@newsread2.news.atl.earthlin k.net...
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?