G
Glint
Hi Guys,
The first part of this question has to do with the design of the database.
The form I need to dsplay has roughly 60 cells. Each cell holds a color and a
number. Is it wise to design the underlying table with 120 fields so that all
the values will be captured, or is it better to have 2 tables (of 60 fields
each) that will be linked by a query? Which design makes for better
performance? I read somewhere that fields should be minimal. But then both
values in each cell have to be kept, no cell being blank. Is there not a
better design than my dumb suggestions?
The second problem is how to retrieve those values. Getting the numbers was
no problem. But the colours gave me horrors. I tried the On Current Event of
the form with Access 2002, and this worked, BUT NOT WITH ACCESS 2007 which I
am now using:
Dim Tx As Control, X As String, Y As Integer
For Each Tx In Me.Controls 'Screen.ActiveForm
If TypeOf Tx Is TextBox Then
For Y = 1 To 9
If Tx.Tag = Y Then
'Tx.BackColor = 16777215
X = Tx.Name & "C"
If Me(X) > 1 Then
Tx.BackColor = 255
Else
Tx.BackColor = 16777215
End If
End If
Next
End If
Next
For this, I had named the fields that held numbers A11 to A80, and the
fields that held the colors a corresponding A11C to A80C. Then I used the Tag
property to separate the textboxes that need to display numbers and colors.
With Access 2007, the numbers display but the form does not change colors,
using the colors of the first record throughout.
My code stretched to Jericho, and I know there has to be a much better way.
Please help.
The first part of this question has to do with the design of the database.
The form I need to dsplay has roughly 60 cells. Each cell holds a color and a
number. Is it wise to design the underlying table with 120 fields so that all
the values will be captured, or is it better to have 2 tables (of 60 fields
each) that will be linked by a query? Which design makes for better
performance? I read somewhere that fields should be minimal. But then both
values in each cell have to be kept, no cell being blank. Is there not a
better design than my dumb suggestions?
The second problem is how to retrieve those values. Getting the numbers was
no problem. But the colours gave me horrors. I tried the On Current Event of
the form with Access 2002, and this worked, BUT NOT WITH ACCESS 2007 which I
am now using:
Dim Tx As Control, X As String, Y As Integer
For Each Tx In Me.Controls 'Screen.ActiveForm
If TypeOf Tx Is TextBox Then
For Y = 1 To 9
If Tx.Tag = Y Then
'Tx.BackColor = 16777215
X = Tx.Name & "C"
If Me(X) > 1 Then
Tx.BackColor = 255
Else
Tx.BackColor = 16777215
End If
End If
Next
End If
Next
For this, I had named the fields that held numbers A11 to A80, and the
fields that held the colors a corresponding A11C to A80C. Then I used the Tag
property to separate the textboxes that need to display numbers and colors.
With Access 2007, the numbers display but the form does not change colors,
using the colors of the first record throughout.
My code stretched to Jericho, and I know there has to be a much better way.
Please help.