2 problems with one form.

bojbrown

Registered User.
Local time
Today, 16:55
Joined
Mar 24, 2004
Messages
18
I have to create a form for creating schedules for individuals for a client who was very specific about what they wanted. One form that breaks down 24 hours into 15 minute increments and color codes the times (I know...Outlook has a scheduler, but we won't go there).

I have the form and the 96, 15-minute segments with check boxes and a box that displays each segments color. Each check box has been named Check01 thru Check96 (the names are longer but this will suffice).

Problem #1: I have created a table with a 2-field primary key (employee # and date). I can use dlookup to determine if a record exists, but have not found a good way to easily jump to the appropriate record and display the information for the date that they have selected from a calendar. There are several ways to make a specific record the current record when using only one field, but I cannot find the command that will work with 2 fields, especially within a form.

Problem #2: When cycling thru the checkboxes, I was trying to write a simple For...Next loop that would dynamically generate the variable field names such that

FOR n = 1 TO 96
IF ME.CHECKn IS TRUE THEN...
NEXT

I have tried appending with the format command and using other characters for syntax, but nothing seems to work. In fact when I tried to do
CHECK + FORMAT(N,"00") as a way of generating the variable, Access actually took out the plus sign.

I would appreciate any help with either of these situations.

Thank you,
Bruce
 
Try this syntax:

If Me("Check" & Format(n)) = True Then...
 
Thank you...I will try it.
 
RichO,

This works, but how? Does Access automataically build an array of fields? I would have never thought to use any command with ME without the period after it.

Thanks for the help.
 

Users who are viewing this thread

Back
Top Bottom