Question : Access 2007, form datasheet view, change display property of an element based on another element in the record

I have a table that is a list of yes/no questions for each employee.  Every question must be answered.  The questions are organized into groups.  Each group has a title.

The questions and group titles change every year so I just wanted a simple table to display in a datasheet form. The group titles and questions are in the same table.  The title records are marked as titles.  There is a sort key so the questions/group titles can be properly displayed.

The table has 5 fields
  Employee_ID (text)
  Yes_No_Answer (yes/no)
  Question (text)
  Is_this_a_group_title (yes/no)
  Sort_Order (integer)

I have a query that filters based on employee_ID, and sorts on Sort_Order
The information is presented in a datasheet view.

The problem is how can I change the font size of the Question field and hide the Yes_No_Answer if the Is_this_a_group_title is yes.

Thanks

Answer : Access 2007, form datasheet view, change display property of an element based on another element in the record

Hi,

I would agree to LSMConsulting to first separate the topics into one table and the questions to another. This is the way relational databases can be handled easily because you can directly assign questions to titles with simple SQL commands. I would say the time you save to make a simpler UI you will spent later in querying this model. And a frontend which let the user fill a database by copying and pasting a spreadsheet is in my eyes dangerous. It's fine that THIS clerk can do it and compare the results to see it's fine. What if this clerk is in holiday or leaves forever? Can anybody else do the same job? What if the data in the spreadsheet is corrupt for some reason - for example the wrong line is marked as title or problems with datatypes of columns in Excel due to wrong formatting? As you do not control the copy and paste progress only Access itself will try to convert the things and maybe wrong.
Parsing an Excel sheet may be a longer job but it has the advantage that you as the programmer can control the complete import and you can control the format of the columns and rows. You can create a flexible module which is able to be changed easily based on configuration tables if the spreadsheet format ever changes. Anyone can do an import with this model and your data is always safe (and can internally separate the rows in different tables like a real relational model).

To answer your last question: Yes, this is possible with a little trick: Create a textbox which has the same height and width as one row in your continous form, send it to background and lock it and set Enabled to False (so the user cannot click into it). Set the background color to the color you want as normal background and then you can use conditional formatting like LSMConsulting explained above to set the background color of this textbox to a highlight color. Make sure that you also set the "Enabled" property in the conditional formatting to "False", too, otherwise highlighting the textbox would result in the user would be able to click into the text box.

Cheers,

Christian
Random Solutions  
 
programming4us programming4us