i was tired to see info that is only for qry by lack of rownum
so i decide to hide it, realizing no focus anymore i decide to go next item in after update
and can not find why it give an error on the visible and not on the hidden
and the error line works in direct window
and d_d_gotfocus no problem in bdo_afterupdate
Code:
'old situation visible but useless info
Private Sub d_d_GotFocus()
If Forms!balans!bl!d_d = 0 Then
Forms!balans!bl!d_d = DCount("d_d", "bl") + 1
End If
End Sub
Private Sub d_t_GotFocus()
' old situation visible but useless info
If FindValue(Format(Forms!balans!bl!dt, "mmdd"), "0131", "0228", "0331", "0430", "0531", "0630", "0731", "0831", "0930", "1031", "1130", "1231") Then
If Forms!balans!bl!d_t = 0 Then 'was already changed to null and 1st condition
Forms!balans!bl!d_t = DMax("d_t", "bl") + 1
End If
End If
End Sub
Private Sub bdo_AfterUpdate()
'new situation but d_t datasheetcaption " " d_t has same color back/fore ground rule needed the space to align
' d_t is meanwhile changed from 0 to null to create unique index and run in old situation already
' If Forms!balans!bl!d_t Is Null Then '?Forms!balans!bl!d_t --> null ,line but give error 424 object required, so out comment waiting to find solution. .value was also wrong
If FindValue(Format(Forms!balans!bl!dt, "mmdd"), "0131", "0228", "0331", "0430", "0531", "0630", "0731", "0831", "0930", "1031", "1130", "1231") Then
Forms!balans!bl!d_t = DMax("d_t", "bl") + 1
' End If
End If
If Forms!balans!bl!d_d = 0 Then ' d_d is hidden
Forms!balans!bl!d_d = DCount("d_d", "bl") + 1
End If
End Sub