Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Default value using another field in the same table 1

Status
Not open for further replies.

SolEsk

MIS
Oct 21, 2005
3
US
I want to set the default value of a field to a value of another field in the same table. I want to know how to set up the expression in the default value expression builder
 
Hi
Here is an example:
[tt]Private Sub LastName_AfterUpdate()
Me.LastName.DefaultValue = Chr(34) & Me.LastName & Chr(34)
End Sub[/tt]

If you provide a little more information, it may be possible to give a better example.
 
I have two Date/Time data type fields on an Access table. What I want to do is I want to set the default value of one of the fields to the other Date/Time data type field on the same table.

Eg. Field 1 = InitialDeliveryDate
Field 2 = AcctualDeliveryDate

This two field are on the same table. I want Field2 to be set to Field1 as its default value. The bottom line is how do I set the default value of a field using another field on the same table.

 
I do not think you can do this with a table. Can you use a form?
 
I was hopping to avoid using Forms. But after I tought about it, it is not possible to initialize a default value of a field using another field in the same table. Because it will assume the field to be initialized must be created after the field that will be used to for initialization. The default value is set when a field is created. If both field are created and they are both blank, the default value will be always blank.

Thank you Remou for trying.

SolEsk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top