Techtravel
13 years agoOccasional Contributor
Trying to get a current date to enter into a field
Here is the originally generated vb script:
Call SSCalendarMaskedEdit.Keys("03152011[Tab]")
And we are attempting to place a current date into the field minus a set number of days and all of our current attempts to seems to cause errors and I'm unsure what were putting in wrong. To clarify Current Date Minus say 15 days (Ex. 10/30/2011 - 15 days = 10/15/2011)
Here is one of our recent attempts: Giving the error - Object required: 'DateValue(...)'
Dim dtmTest
Dim formatedDate
Dim currentDate
Set currentDate = DateValue(Now)
Set dtmTest = DateAdd("D", -15, currentDate)
Set formatedDate = Format(dtmTest, "mmddyyyy")
Call SSCalendarMaskedEdit.Keys(formatedDate & "[Tab]")
The way we have achieved this in the past using a slightly different method was such:
(Format(DateAdd("D", -15, Now), "mmddyyyy") )
This would not work either.
Can anyone assist me with the proper terms that will work within TestComplete?
Also, the return for 3/1/2011 would need to be formatted like: 03012011
Thanks for the help
Call SSCalendarMaskedEdit.Keys("03152011[Tab]")
And we are attempting to place a current date into the field minus a set number of days and all of our current attempts to seems to cause errors and I'm unsure what were putting in wrong. To clarify Current Date Minus say 15 days (Ex. 10/30/2011 - 15 days = 10/15/2011)
Here is one of our recent attempts: Giving the error - Object required: 'DateValue(...)'
Dim dtmTest
Dim formatedDate
Dim currentDate
Set currentDate = DateValue(Now)
Set dtmTest = DateAdd("D", -15, currentDate)
Set formatedDate = Format(dtmTest, "mmddyyyy")
Call SSCalendarMaskedEdit.Keys(formatedDate & "[Tab]")
The way we have achieved this in the past using a slightly different method was such:
(Format(DateAdd("D", -15, Now), "mmddyyyy") )
This would not work either.
Can anyone assist me with the proper terms that will work within TestComplete?
Also, the return for 3/1/2011 would need to be formatted like: 03012011
Thanks for the help