By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

Default Value of field

P: 7
Hello,

I have problem in setting default value of field. What I want to do is as follows.
I have 'Table' with fields 'PurchaseDate' and 'CapitalisationDate'. I want to set dafault value of field 'CapitalisationDate' as date entered in field 'PurchaseDate". But user will have option to change it. That means unless user changes value in field 'CapitalisationDate' , it will be same as date in field 'PurchaseDate'.
How to do this? Please help me.
May 10 '07 #1
Share this Question
Share on Google+
5 Replies


puppydogbuddy
Expert 100+
P: 1,923
Yes, you can. Go to the table properties for the CapitalizationDate field and you will see a property called default value. In the space provided type the following without an equal sign:[PurchaseDate]

This will cause the capitalization date field to default to the purchase date. The default value is overwritten if anything is typed in the field.
May 10 '07 #2

JConsulting
Expert 100+
P: 603
Hello,

I have problem in setting default value of field. What I want to do is as follows.
I have 'Table' with fields 'PurchaseDate' and 'CapitalisationDate'. I want to set dafault value of field 'CapitalisationDate' as date entered in field 'PurchaseDate". But user will have option to change it. That means unless user changes value in field 'CapitalisationDate' , it will be same as date in field 'PurchaseDate'.
How to do this? Please help me.
I think you may want to set the after update event of the PurchaseDate instead

Private Sub PurchaseDate_AfterUpdate()
me.CapitalisationDate = nz(me.PurchaseDate,Date())
end sub

the table method will not know what to do if the PurchaseDate is null
J
May 10 '07 #3

JConsulting
Expert 100+
P: 603
Yes, you can. Go to the table properties for the CapitalizationDate field and you will see a property called default value. In the space provided type the following without an equal sign:[PurchaseDate]

This will cause the capitalization date field to default to the purchase date. The default value is overwritten if anything is typed in the field.
pDog! good to see you out and about
J
May 10 '07 #4

P: 7
Thank You very much. 'After Update Event' worked perfectly.
May 11 '07 #5

JConsulting
Expert 100+
P: 603
Thank You very much. 'After Update Event' worked perfectly.
Happy to help.
J
May 11 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.