View Full Version : Calculated Field on form


Hayley Baxter
12-17-2001, 12:31 AM
I have a database that contains details of suppliers and all the contracts they have. I am trying to create a calculated field on my form that will tell me when the contract expires 3mths in advance. For example if I have a contract due to expire in March I want to know of this in December. I have been experimenting with some criteria and it seems that when I enter an expression to be taken 3mths from the current date this works fine, however when I try entering code from the field contract end date in my table it doesnt want to know I get #Name? Ive looked up the reasons for this in help which seems it could be the brackets etc

I typed = DateAdd("d",90,[contractenddate])
I would also like to display this for the duration of the 3mths of expiry not just on the 1st date it falls into this criteria. Can anyone help me I've been struggling away at this for some time now!

Any help greatly appreciated

Managed to resolve first part of this problem but still need a method to show up for duration of 3mth period. Im looking to select a supplier from my drop down list contract details show in subform. If contact is within 3mth expiry display msgbox on click stating this.

[This message has been edited by Hayley Baxter (edited 12-17-2001).]

Hayley Baxter
12-17-2001, 01:19 AM
I have the following code behind my combobox which is not creating any errors but is not doing anything on my form

Private Sub Combo80_Click()
If Contract_End_Date = Expiry_Warning Then
MsgBox "The contract is due to expire" & (Expiry_Warning)
Else
'do nothing
End If
End Sub

I have a fresh problem where the details on my form(supp name add) drawn from the combobox is not displayed unless the criteria for my date function(above) is met. I want the supp details to be shown regardless if the supplier has a contract or not.

Someone please help Im tearing my hair out with this!

[This message has been edited by Hayley Baxter (edited 12-17-2001).]

[This message has been edited by Hayley Baxter (edited 12-17-2001).]