lots of google gave me the hidden fields back, but not why it went hidden and hidden again after repair.
the error on invalid statements that was working before is not yet found bec 1st need the form run again and it is running if i size manual
i have running database with sensitive information, so upload database is not very smart to do and complex to empty.
the structure is date,daily sequence,monthly sequence, several money fields; both sequences are generated by vba.
yup i had first only 1 money field with link field to name of money field, but that was very slow and very complex.
subformA show 2 lines of the table, and new record is daily added here.
surformB show union sql calculating : daily difference d_d-1 & monthly difference d_t-1 both total difference & total som of d_d
the code below is initial on form_load setting field width and layout.
noticing that conditiong format was lot of work, so switched to vba.
the comment are for keep running, need removed again. form is ok na with manual sizing '
after i added the color on the fields , 2 strange things happend:
1) subformA (bl) all was hidden and not selectable; right mouse give popup with all fields unselected
2)mainform_load give error 2455 on all old statements with subformB (bl2) in it. remove the new added remove the problem
btw seems that 2455 and 2465 are random popping up the explaining text
repair restart and give hidden again and same error again
Code:
Dim mh As LongDim w As Long
Dim h As Long
Public Const bb As Long = 16777215
Public Const fb As Long = 4210752
Public Sub bli(fst As Boolean)
Dim ctl As Control
Dim frms As Variant
Dim frm As Variant
Dim i As Integer
i = 0
If fst Then
Forms!balans.Form.SetFocus
Scr 'screen size
GTL 'text size hidden routine
Forms!balans.Form.AutoResize = False
Forms!balans.Form.FitToScreen = False
Forms!balans.Form.RecordSelectors = False
Forms!balans.Form.NavigationButtons = False
Forms!balans.Form.Move 0, 0, mw, mh
End If
frms = Array("bl", "bl2")
For Each frm In frms
If frm = "bl2" Then
' Forms!balans!(frm).Form.RecordSelectors = False
' Forms!balans!(frm).Form.NavigationButtons = False
Else
Forms!balans!(frm).Form.AutoCenter = False
Forms!balans!(frm).Form.AutoResize = False
Forms!balans!(frm).Form.FitToScreen = False
End If
' For Each ctl In Forms!balans!(frm).Form.Controls --> error if bl2
' With ctl
' If .ControlType = acTextBox Then
' .CanGrow = True
' .CanShrink = True
' .TextAlign = 3
' Select Case .Name
' Case Is = "pro"
' .ColumnWidth = w * 13 / 12
' Case Is = "dau"
' .ColumnWidth = w * 13 / 12
' Case Is = "ros"
' .ColumnWidth = w * 13 / 12
' Case Is = "Tot"
' .ColumnWidth = w + w / 5
' Case Is = "dt"
' .ColumnWidth = w - w / 12
' Case Is = "d_t"
' .ColumnWidth = w / 2
' Case Is = "d_d"
' .ColumnWidth = w / 2
' Case Is = "h"
' .Properties("ColumnHidden") = True
' Case Is = "t"
' .Properties("ColumnHidden") = True
' Case Else
' .ColumnWidth = w
' End Select
' End If
' End With
' Next ctl
Next frm
------------------------------->new extra to color fields worked with debug.print
'Dim rst As Recordset
'Dim j As Integer
'Dim dtt As String
'Dim hh As Integer
'Set rst = Forms!balans!bl2.Form.RecordsetClone --> error
'rst.MoveFirst
'Do Until rst.EOF
'Forms!balans!bl2.Form.Bookmark = rst.Bookmark
'j = 0
'For Each ctl In Forms!balans!bl2.Form.Controls
'With ctl
'If .ControlType = acTextBox Then
'Select Case j
'Case Is = 0
' hh = .Value
'Case 3 To 10 --> debug.print .value was ok
' If hh = 1 And .Value > 0 Then 'daily
' .BackColor = bb
' .ForeColor = fb
' End If
' End Select
'j = j + 1
'End If
'End With
'Next ctl
'rst.MoveNext
'Loop
End Sub