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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Range Question

Status
Not open for further replies.

PaulChilds

Technical User
May 21, 2002
195
Hello,

A question for you.

I'm making a database which keeps track of all the IT equipment that our employees borrow. In the form called Loan, I enter the [User] name, the [Equipment] borrowed (subform - people can borrow more than one item at a time), the [Collection Date] and the [Return Date] there is also a Transaction Number called [LoanID].

I would like to create a textbox which says either "This loan is impending", "These items are currently on loan" or "The loan is passed it's return date".

Any ideas?
 
Hi,

Try building a function as below :

Function test([Collection Date] as date, [Return Date] as date)
If [Collection Date] > Date Then
test = "This loan is impending"
ElseIf [Return Date] <= Date Then
test = "These items are currently on loan"
Else
test = "The loan is passed it's return date"
End If
End Function

then build a reference to it as a new variable in the query that the forms based on and add it to the form
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top