Cro,
Re: Checkbox and Combobox
Look at your form in design view. There is only one combobox there. When you see
your form in form view and you see multiple records, there is still one combobox
but an instance of that same combobox for each record. The long and short of it
is that if you disable the combobox, since there is only one, it will be
disabled in every instance, ie, every record. You need to change your logic to
something else rather than disabling the combobox. Take a loof at conditional
formatting to see if there is something there you might use.
Re: Staffhours Form
To begin with, your table has fundamental problems. The first problem is that
the table is not normalized. You should not have multiple time fields but rather
a table such as:
TblStaff
StaffID
FName
LName
TblTimeOfDay
TimeOfDayID
TimeOfDay
TblStaffAvailability
StaffAvailabilityID
StaffID
AvailabilityDate
TimeOfDayID
Available (Y/N)
The second problem in your current table is the field named "Date". Date is a
reserved word in Access and should not be used as a field name. Note above, I
used "AvailabilityDate" as the field name.
You now need a form/subform. The main form should be base on a query based on
TblStaff to be able to display staff records in alphabetical order. The subform
should be based on a query based on TblStaffAvailability. The LinkMaster and
LinkChild properties of the subform control should be set as StaffID. Again,
there is one control for each field in the subform so you can't set the the
color of the rectangle the way you are without setting the color of all
instances of the same rectangle. Rather, use conditional formatting here - it
will give you the effect you want.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com www.pcdatasheet.com
"Cro" <th*******@hotmail.com> wrote in message
news:24**************************@posting.google.c om...
Dear Access Developers,
I am developing a form with 'default view' set to "continuous forms".
I am suffering with a problem I can't yet see a solution too.
Each record has many fields. Two fields I would like to add a little
extra functionality to are a check box and a combo box. More
explicitly, I would like the 'enabled' property of a combo box control
to be dependent on the value of a check box (a 'yes/no' field) in the
same record. When the check box is unchecked the combo box should be
available and when the check box is checked, the combo box should be
unavailable.
My efforts thus far have disabled every single combo box on the form
rather than only disabling the combo box for one particular record.
How can I 'single out' particular controls for particular records?
I also have a related problem in another form.
I am using rectangles to show staff availability for certain hours of
a given day. My form (again with 'default view' set to "continuous
forms") is based on a table called 'Staff Hours' with fields:
Name (PK), Date (PK), 0000-0010, 0020-0030, .... , 2300-0000
(Where 2300-0000 holds the data 'yes' or 'no' depending on whether
that particular staff member is working on a particular date in the
hour 11pm to 12pm).
Unfortunately, when I set the colour of the rectangles according to
the data in the table, the colour is set for every rectangle on the
form rather than just for the particular record it is appropriate to.
These two problems are related and I'd be extremely grateful for a
solution.
What do you think?
Thank very much.
Regards,
Cro