Setting DefaultValue Property

M

Mark

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
 
A

Allen Browne

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"""
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top