Default Value

Joined
Jul 23, 2012
Messages
8
Reaction score
0
I have a table for precission tooling which requires calibration. In the table I am attempting to set the default value using two values in the table. One value is in a column for the last date of calibration, and the other value is in a column for the due date. Using those two dates I am attempting get the days remaining field to auto populate.

I have set the paramets in the Default Value field for the tabel using the DateDiff Function as follows.
DateDiff("d", inst_cal_cw, inst_cal_due,,)

When I try to save the table, it tells me that it doesn't recognize the values. Not sure what I am doing wrong here but I am sure that it is something simple in the syntax that I have missed. Any help here is appriciated.
 
What are you working in? An Access database? SQL? Other? If you give a little more info, I or (probably) someone else might be able to help you out with it.
 
I have a table for precission tooling which requires calibration. In the table I am attempting to set the default value using two values in the table. One value is in a column for the last date of calibration, and the other value is in a column for the due date. Using those two dates I am attempting get the days remaining field to auto populate.

I have set the paramets in the Default Value field for the tabel using the DateDiff Function as follows.
DateDiff("d", inst_cal_cw, inst_cal_due,,)

When I try to save the table, it tells me that it doesn't recognize the values. Not sure what I am doing wrong here but I am sure that it is something simple in the syntax that I have missed. Any help here is appriciated.

-----------

I have had similar issues in the past. The fix I found was to use the CONTROL NAMES (from the form) in the formula instead of the FIELD NAMES (from the table).

What I mean is, create text box controls on the form, bind the two fields to the controls, then modify the formula by substituting the control names for the field names.

The new formula would be:

DateDiff("d", TXTinst_cal_cw, TXTinst_cal_due,,) (where TXT... indicates the control name).

The Default Value property appears to be able to access the controls on the form but not the fields in the recordset behind the form.

Hope this helps...
 
Back
Top