G
Guest
I am just making my way through a data base program. I am using access to
schedule out events based on dates and days of occurence. I wrote a loop so
that the schedule would ignore weekends, however, I have a table of holidays
I also want it to ignore. I want to read in the dates into an array
Holiday(x) and check those against schedule dates. I am having problems
determining exactly how to go from an existing open form, open up the
"Holidays" table, read in the dates and store in an arryan and then use them.
While in a "Schedule" form I am using the AfterUpdate for field on the form.
Whenever a user changes a date in the list, the program runs down a list of
dates on the "schedule" form and updates them. Just before the updates, I
need to read in the holiday date values so that I can ignore those dates.
Inside the private sub "aferupdate" I think I want to do the following (sorry
for the code typos).
Docmd.openform "Holidays",,acnormal
Docmd.gotorecord acfirst
X=1
Do while Holidays.EOF = False
HolidayDateVariable(X) = HolidayDate.value
X=X +1
Docmd.gotorecord acnext
Loop
1. Can I do this from inside a private sub?
1a. I am having problems with the program recognizing "HolidayDate.value" so
I assume the answer to 1. is no. If so, can I run the whole thing from
outside in a module?
2. How do I then refocus on back to my original "Schedule" form?
3. Is it better to read in the holiday data from a form or the data table
itself?
schedule out events based on dates and days of occurence. I wrote a loop so
that the schedule would ignore weekends, however, I have a table of holidays
I also want it to ignore. I want to read in the dates into an array
Holiday(x) and check those against schedule dates. I am having problems
determining exactly how to go from an existing open form, open up the
"Holidays" table, read in the dates and store in an arryan and then use them.
While in a "Schedule" form I am using the AfterUpdate for field on the form.
Whenever a user changes a date in the list, the program runs down a list of
dates on the "schedule" form and updates them. Just before the updates, I
need to read in the holiday date values so that I can ignore those dates.
Inside the private sub "aferupdate" I think I want to do the following (sorry
for the code typos).
Docmd.openform "Holidays",,acnormal
Docmd.gotorecord acfirst
X=1
Do while Holidays.EOF = False
HolidayDateVariable(X) = HolidayDate.value
X=X +1
Docmd.gotorecord acnext
Loop
1. Can I do this from inside a private sub?
1a. I am having problems with the program recognizing "HolidayDate.value" so
I assume the answer to 1. is no. If so, can I run the whole thing from
outside in a module?
2. How do I then refocus on back to my original "Schedule" form?
3. Is it better to read in the holiday data from a form or the data table
itself?