CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Updating Hidden Date Field

Print topic Send  topic

Author Message
afrausto

Posts: 66
Posted: 09/27/2005, 10:41 AM

Hello,

I have a Record Form that contains two dates: EventDate and TicketMailingDate. TicketMailingDate is a hidden text value.

I'm trying to set a date value to a TicketMailingDate in the Before Insert event. This is my code:

Dim EventDate
Request.Querystring("EventDate")

Donations.TicketMailingDate.value = DateAdd("d",-56,EventDate)

All dates are set to mm-dd-yyyy. When I submit a test form with an Event Date of 9/29/2006 the TicketMailingDate shows 11/4/1899.

Is there something I'm missing. Do I need to convert EventDate?
Thanks for your suggestions?

Albert
View profile  Send private message
Edd


Posts: 547
Posted: 09/28/2005, 7:37 AM

Albert,
The reason you got a date 11/4/1899 was becase the date EventDate was empty.

Have you tried

Dim EventDate
EventDate = Donations.EventDate.Value
If Not IsEmpty(EventDate ) THen
Donations.TicketMailingDate.value = DateAdd("d",-56,EventDate)
End If


Edd

_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
afrausto

Posts: 66
Posted: 09/28/2005, 8:17 AM

Edd,

Thanks for the insight. I was able to find a solution. The field Event Date is a required field in the form being submitted. So I knew it wasn't empty. It seems that in the Before Insert event I had set

Donations.EventDate.value = Request.Querystring("EventDate")

early in my code and later I set

EventCode = Request.Querystring("EventDate") (Not sure why I did this...)

I believe the second Request.Querystring("EventDate") for EventCode was cleared. That is why, as you pointed out, I was getting the strange date of 11/4/1899.

Anyways, this is what I did to resolve my issue:

Donations.TicketMailingDate.value = DateAdd("d",-56,Donations.EventDate.value)

Thanks again for your help.

Albert
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.