For those who were following my miserable quest on why access 2002 form crashes for no obvious reason (thank you for all the tips already), I have a new theory. By removing some related code, so far I had no crashes any more. However this code is essential for me to display data in a sub form:
Function bitCompare(intByte As Byte, intBitNumber As Integer) As Boolean
If (intByte And 2 ^ intBitNumber) Then bitCompare = True Else bitCompare = False
End Function
This one takes a byte value (which is actually saved in the record as a byte integer number) and checks if a specific bit (numbered 0 to 7) is set or not set. I am doing it this way to save space (1 byte < 2 bytes * 8 checkboxes = 16 bytes).
In a continous subform I then have several checkboxes with controlsource properies "=bitCompare(intByte@record, 0/1/2/3/etc..."
This code works fine - it does what it is supposed to do. Except it crashes sometimes...
- Is anything wrong with this code?
- Are 150 executions of this code (= # of entries @ subform) too much for Access?
(Problem is I can not go back to true boolean values, because large amounts of data were input already; also this would increase the size of the database by factor 16 (10 MB -> 160 MB - undiscussable!))
Function bitCompare(intByte As Byte, intBitNumber As Integer) As Boolean
If (intByte And 2 ^ intBitNumber) Then bitCompare = True Else bitCompare = False
End Function
This one takes a byte value (which is actually saved in the record as a byte integer number) and checks if a specific bit (numbered 0 to 7) is set or not set. I am doing it this way to save space (1 byte < 2 bytes * 8 checkboxes = 16 bytes).
In a continous subform I then have several checkboxes with controlsource properies "=bitCompare(intByte@record, 0/1/2/3/etc..."
This code works fine - it does what it is supposed to do. Except it crashes sometimes...
- Is anything wrong with this code?
- Are 150 executions of this code (= # of entries @ subform) too much for Access?
(Problem is I can not go back to true boolean values, because large amounts of data were input already; also this would increase the size of the database by factor 16 (10 MB -> 160 MB - undiscussable!))