|
-
Sep 15th, 2000, 01:51 PM
#1
Thread Starter
Junior Member
I have two maskeditboxes side by side with a mask of ##/##/##
I have the following code behind a command button
Dim StartDay As String
Dim Endday As String
'fill variables
StartDay = effdate.Text
Endday = expdate.Text
Endday = DateAdd("y", 365, StartDay)
When I click the button nothing happens...This may be due to they are maskeditboxes but im not sure please help...
-
Sep 15th, 2000, 01:57 PM
#2
At first: the maskeditbox from microsoft don't work correctly
Correct Code
dim StartDay as date,EndDay as date
startday=cdate(effdate.text)
endday=dateadd("y",1,startday)
expdate.text=endday
-
Sep 15th, 2000, 03:06 PM
#3
Thread Starter
Junior Member
I get an error message invalid property value on
expdate.Text = EndDay
-
Sep 15th, 2000, 03:27 PM
#4
i found the error
expdate.text=format(endday,UserFormat)
UserFormat is the same format then the format of the MaskEdit- Control
example: MaskEdit Format dd.mm.yyyy then Userformat dd.mm.yyyy
all ok
-
Sep 15th, 2000, 03:34 PM
#5
Thread Starter
Junior Member
Did you try it? It still doesnt put it one year ahead...10/10/00 goes to 10/11/01 I cant figure out why
-
Sep 15th, 2000, 03:42 PM
#6
what date should be in the second MaskEditbox ??
The last day of this year or your start date + one year ??
-
Sep 15th, 2000, 03:46 PM
#7
Thread Starter
Junior Member
Start date plus one year...Its almost doing it..but it is usally one day later then the correct one
like i enter 10/10/00
and then the second box shows 10/11/01
need it to be 10/10/01
-
Sep 15th, 2000, 03:48 PM
#8
Answer
then make EndDay=EndDay-1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|