I need to create a report that shows in calendar form each patch window, the date and the time they start.
tblPatchWindows includes the following fields:
1. PatchWindow
2. PatchDate
3. PatchStartTime
I would like them to display something like the following in a report: (ignore "-")
------------------------4/1/08--4/2/08--4/3/08
PatchWindow1--12:00a
PatchWindow2--------------3:00a...
User Profile
Collapse
-
Patch Windows Pt3 - Calender Schedule Report
-
I think i figured it out...
Private Sub PatchDateFuncti on_AfterUpdate( )
Dim strFunctionName As String
strFunctionName = [PatchDateFuncti on]
[PatchDate] = Eval(strFunctio nName)
End Sub
It seems to work, but seems.... crude somehow. -
Using a string to call a function
I have a combobox with a list of names that reflect a list of functions. The name of this combobox is [PatchDateFuncti on]. When a specific function name is chosen from that list I want to make [PatchDate] = functionname.
I have a total of 34 functions, each of which calculates various dates. For simplicity I will show two here.
Function First_Saturday( ) As Date...
For x = 0 To 6
If Weekday(DateSer ial(Year(Date), -
Woot got it to work... i was putting down Form! instead of Forms! when pointing to an object!!!!!!Leave a comment:
-
Now Im confused :-)
I am calling an [Event Procedure] from the Combo Box: MonthCombo After Update property.
This [Event Procedure] points to
Private Sub MonthCombo_Afte rUpdate(Cancel As Integer)
[test] = First_Saturday
End Sub
First_Saturday is the following Function
Public Function First_Saturday( ) As Date...
For x = 0 To 6
If Weekday(DateSer ial(Year(Date),Leave a comment:
-
I assume since its just Function and not Public Function that would make it private. I tried Public Function but that didnt work either.
If you look at a previous post in which I posted the actual Function you can see that there is no need to pass the parameter Month.
The combobox was in the header of the form, however, it also failed in the details section.
Me.Requery also failed. this is most likely...Leave a comment:
-
Here is the Function First_Saturday( )
Function First_Saturday( ) As Date
For x = 0 To 6
If Weekday(DateSer ial(Year(Date), Month(Date), 1) + x, vbUseSystemDayO fWeek) = vbSaturday Then
First_Saturday = DateSerial(Year (Date), Month(Date), 1) + x
End If
Next x
End Function...Leave a comment:
-
Unable to open function inside a method
The following is a quick example of what I am trying to do:
---
Private Sub MonthCombo_Afte rUpdate(Cancel As Integer)
[test] = First_Saturday( )
End Sub
---
Basically when the user changes the month in the form header it will update all the patch windows using their particular function.
MonthCombo is a control box in a form
[test] is a textbox... -
I used the information you gave me to create 33 functions. They all work perfect now, but Ive run into another problem.
The following is a quick example of what I am trying to do:
---
Private Sub MonthCombo_Afte rUpdate(Cancel As Integer)
[test] = First_Saturday( )
End Sub
---
Basically when the user changes the month in the form header it will update all the...Leave a comment:
-
Wow! Thanks for the quick response. Its midnight here, didnt think anyone would reply until tomorrow morning. You rock!Leave a comment:
-
Calculating 2nd Thursday after 1st Tuesday in a Month
I need to create a database that will be used to schedule patches. Many of our patches happen on the 1st Saturday of the month, but some happen on the 2nd Thursday after the 1st Tuesday every month.
Ive been attempting to use the DATEPART and WEEKDAY functions but without success. Figuring out the 1st Saturday shouldnt be to hard, even if I havent managed to figure that out just yet, but the other is beyond my experience.
No activity results to display
Show More
Leave a comment: