Results 1 to 6 of 6
  1. #1
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204

    suddenly error 2455/2465

    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
    Attached Thumbnails Attached Thumbnails Screenshot 2024-08-07 083935.png   Screenshot 2024-08-07 084003.png  
    Last edited by ano; 08-06-2024 at 07:08 PM. Reason: missing screenshot

  2. #2
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204
    i think i have found the problem:
    fm20 was working but not long ago added
    fm20 is in regedit not same location as in preference
    fm20 was not in windows\system32
    copy and change regedit did not give solution
    look at screenshot
    vbe7.dll has same problem as fm20
    after checking and changing all the reference in use still error and sometimes all fields hidden sometimes both subforms or only 1st
    uninstall 365 , check register reboot , install still problem but references seems ok
    Attached Thumbnails Attached Thumbnails Screenshot 2024-08-10 113345.jpg  
    Last edited by ano; 08-10-2024 at 04:08 AM. Reason: problem not solved

  3. #3
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204

    2455 in loop 1st ok 2nd error

    the error suggest a type error or a construction error, but i ignored that the 2nd give an error , so its a quite different error.
    putting a debug.print give 1st time no error and debug.print info from both forms
    after that the 2nd form keep giving error end 1st form goes all hidden fields
    who has any idea whats is happening?
    Attached Thumbnails Attached Thumbnails Screenshot 2024-08-10 212701.png  

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    If you are trying to include a subform in your reference, the syntax is
    Forms!MainFormName.subformcontrolname.Form - then whatever you need after that. You seem to be omitting the subform control name part.
    If frm is supposed to be an object (form) why would you declare it as a variant?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204
    Quote Originally Posted by Micron View Post
    If you are trying to include a subform in your reference, the syntax is
    Forms!MainFormName.subformcontrolname.Form - then whatever you need after that. You seem to be omitting the subform control name part.
    If frm is supposed to be an object (form) why would you declare it as a variant?
    it is running for several weeks without any issue.
    probably i copy form a search.
    after trying adding color all fields conditional the problem started , but comment out did not solve it
    after adding debug,print it run both form well again.
    after restart the error came back.
    so u suggest chnage variant into form but it is not a form its a string array

  6. #6
    ano is offline Competent Performer
    Windows 11 Office 365
    Join Date
    Nov 2023
    Posts
    204

    solved

    it is solved !
    type error in calling sub
    so the error was subform not loaded yet
    what i not understand is why the routine also not work if moved from main form to the 2nd subform
    Last edited by ano; 08-11-2024 at 05:20 PM.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 09-07-2023, 09:22 AM
  2. Replies: 10
    Last Post: 09-06-2021, 03:53 PM
  3. Hide/Show fields at Form based on checkbox
    By cap.zadi in forum Forms
    Replies: 8
    Last Post: 04-22-2016, 05:08 AM
  4. Replies: 6
    Last Post: 12-13-2014, 09:20 PM
  5. Finished Database - Question
    By theilercabin in forum Access
    Replies: 2
    Last Post: 10-10-2011, 02:29 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums