Data Access Page onload event problem

psenechal

New member
Local time
Today, 13:33
Joined
Aug 3, 2006
Messages
5
This behavior is driving me crazy!

I have a data access page with an onload event for the window. All I want to do is go to a new record, update a date field with today's date and save the record. Here is the code:

<SCRIPT language=vbscript event=onload for=window>
<!--
window.MSODSC.CurrentSection.DataPage.NewRecord
request_date.value=DateValue(Now)
MSODSC.DataPages(0).Save()
-->
</SCRIPT>

When I load the page, I can see the date pop into the request_date field, but then it disappears. I made sure the value update code works by putting it on a different object's click event. The problem is when it's in the onload event for the window.

Is there something I'm missing about this event that prevents this from working? Thanks!
 
Well, I found a way around this problem. I created an onFocus event for the first object on the data access page. Since this object gets focus as soon as the page loads, it runs immediately and everything works.
 
Dude You Are My Freaking Hero! I Had A Really Similar Problem Where I Was Comparing 2 Dates But My Dap Would Compile Run My Java And Then Load The Data! My Objects Won't Get Focus Until The Data Is In! You Are My Hero!!!!!!!
 

Users who are viewing this thread

Back
Top Bottom