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

add six months with a yes/no tick box 1

Status
Not open for further replies.

clobo

Technical User
Sep 16, 2008
5
PT
Hi!

I am trying to create a data base to control the loan dates of plants. Normally, we have a certain plant species that are lent for a period of 6 months. After those six months they should be sent back or else, we need to postpone the loan for another six months.

So I have a table of loans, with the species id number, date of loan, and date of expected return. What I need is some sort of command/query where I can use a yes/no tick box so that when I put the tick on the box, the computer automatically adds 6 months to an expected date of return of a plant, thus postponing the return date for six months.
Can this be done?
Thanks for your time
Best wishes
Carlos
 
How are ya clobo . . .

You don't really need the checkbox. You could use the [blue]Double-Click[/blue] event of your [blue]date of return[/blue] textbox along with the [blue]DateAdd[/blue] function to accomplish your task.

[blue]Your Thoughts? . . .[/blue]

BTW: Welcome to [blue]Tek-Tips![/blue] [thumbsup2]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
thanks for the tip. I think that your solution is much more simple and practical than the one I thought of in the first place. Nevertheless, can you give me some help with the code so that the double click funtion will add six months to the date alrerady in the text box

Thanks for the help

best wishes

Carlos
 

Last post answered in OP's new thread.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
clobo . . .

Sorry for getting back so late. Try this:
Code:
[blue]   If IsDate(Me!qDate) Then
      Me!qDate = DateAdd("m", 6, Me!qDate)
   End If[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
clobo . . .

The code I presented should read:
Code:
[blue]   If IsDate(Me![[purple][b][i]ReturnTextboxName[/i][/b][/purple]]) Then
      Me![[purple][b][i]ReturnTextboxName[/i][/b][/purple]] = DateAdd("m", 6, Me![[purple][b][i]ReturnTextboxName[/i][/b][/purple]])
   End If[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks a lot. It worked perfectly
Regards
Carlos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top