parallon
03-23-2006, 03:26 PM
Hello all,
We have a current application written in the backend of Access using vbscript, and we are trying to bring this application to the web. There is a function/subroutine in the program which I need, and I was wondering what sort of alterations to the code would be needed to include this in my ASP pages? I tried the copy and paste, with no prevail. I am under the impression that vbscript can be used in ASP.
Code in MS Access:
Private Sub ThisWeek_Click()
Ago = Weekday(Now, 1)
If Ago = 1 Then
StartDate = Date() - 3 - Ago
'Date = Now - 3 - Ago
EndDate = StartDate + 6
Else
If Ago = 2 Then
StartDate = Now - 3 - Ago
'Date = Now - 3 - Ago
EndDate = StartDate + 6
Else
If Ago = 3 Then
StartDate = Now - 3 - Ago
'Date = Now - 3 - Ago
EndDate = StartDate + 6
Else
StartDate = Now + 4 - Ago
'Date = Now + 4 - Ago
EndDate = StartDate + 6
End If
End If
End If
Me![StartDate].Value = Month([StartDate]) & "/" & Day([StartDate]) & "/" & Year([StartDate])
Me![EndDate].Value = Month([EndDate]) & "/" & Day(Me![EndDate]) & "/" & Year(Me![EndDate])
Me![EmpName].SetFocus
End Sub
There are a couple other routines that I need also, but if I could just get an idea of the difference in the format, I think I could go from there.
Thanks in advance,
Parallon
We have a current application written in the backend of Access using vbscript, and we are trying to bring this application to the web. There is a function/subroutine in the program which I need, and I was wondering what sort of alterations to the code would be needed to include this in my ASP pages? I tried the copy and paste, with no prevail. I am under the impression that vbscript can be used in ASP.
Code in MS Access:
Private Sub ThisWeek_Click()
Ago = Weekday(Now, 1)
If Ago = 1 Then
StartDate = Date() - 3 - Ago
'Date = Now - 3 - Ago
EndDate = StartDate + 6
Else
If Ago = 2 Then
StartDate = Now - 3 - Ago
'Date = Now - 3 - Ago
EndDate = StartDate + 6
Else
If Ago = 3 Then
StartDate = Now - 3 - Ago
'Date = Now - 3 - Ago
EndDate = StartDate + 6
Else
StartDate = Now + 4 - Ago
'Date = Now + 4 - Ago
EndDate = StartDate + 6
End If
End If
End If
Me![StartDate].Value = Month([StartDate]) & "/" & Day([StartDate]) & "/" & Year([StartDate])
Me![EndDate].Value = Month([EndDate]) & "/" & Day(Me![EndDate]) & "/" & Year(Me![EndDate])
Me![EmpName].SetFocus
End Sub
There are a couple other routines that I need also, but if I could just get an idea of the difference in the format, I think I could go from there.
Thanks in advance,
Parallon