ListO
Señor Member
- Local time
- Today, 14:21
- Joined
- Feb 2, 2000
- Messages
- 162
On a form called "MainLarge" I have a field from my table called "Tag," which is Boolean.
I want a public subroutine to process the state of that field with the following code (truncated here for simplicity). The MainLarge form is open when the subroutine is called.
This fails with a Run-Time Error 13 - Type Mismatch.
I'm doing something wrong. What is the correct way to work with booleans in this situation?
Previously I had this code attached to the form itself and it worked fine.
I want a public subroutine to process the state of that field with the following code (truncated here for simplicity). The MainLarge form is open when the subroutine is called.
Code:
Sub ToggleTag()
Dim TagState As Boolean
TagState = [Forms]![MainLarge].[Tag]
'Process the value of TagState
'Then save it back to the form, and thus, the table
[Forms]![Mainlarge].[Tag] = Tagstate
End Sub
I'm doing something wrong. What is the correct way to work with booleans in this situation?
Previously I had this code attached to the form itself and it worked fine.
Last edited: