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

DATE() 3 months ahead 2

Status
Not open for further replies.

mikeisvfp

Programmer
Mar 5, 2011
91
CA
Dear Experts

I have a checkbox, I would like for the date in my txtbox to move foward 3 months when this checkbox is checked, but i cant seem to get it to work

heres my code in the click event of the checkbox

IF thisform.check1.Value > 1
thisform.txtdate.Value = GOMONTH(DATE(), 3 )
ELSE
ENDIF

datatype is datetime()

what am I doing wrong?
 
>1? How do you get the idea to check for values larger than 1? Even noncomputer people know computers are all about 0s and 1s, not 2s or 3s....

Haven't you done that error before? 0 or 1 are the usual value, or .f. an .t., 2 is also possible, but not by clicking on a checkbox.

In the form set the checkbox value to .f. and then check for .t.

Bye, Olaf.
 
Mike,

What exactly is the problem that you are seeing?

Is it to do with the checkbox value? If so, Olaf has answered that. (In summary, you can programmatically set a checkbox's value to either a logical value (.T. or .F.) or a numeric one (0, 1 or >1). Once you've done that, the checkbox will have that same data type even after the user has clicked on it. So it's a matter of testing for that same data type.)

Or is the problem with the date? You say "datatype is datetime". Data type of what? The textbox? But the data type of the value of a textbox is the data type of whatever value you assign to it, which in this case would be date.

Perhaps you could clarify your problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Mike your right Olaf did answered it


Much thanks Olaf


A lesson is always learned from the both of you, much apreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top