Frustrated because too much was cut out of your code.
Code:
Button1_Click()
BooleanVal = True '<<-- is "BooleanVal" a global variable or a control on the form??
Open Form1
Button2_Click()
BooleanVal = False '<<-- is "BooleanVal" a global variable or a control on the form??
Open Form1
This is the full code?
Do you have
Code:
Option Compare Database
Option Explicit
at the top of EVERY code module? You should....
Code:
Private Sub Form1_Load_Form()
Dim BooleanVal as Boolean '<<-- not used
Dim temPval as Boolean
Dim RecordNumber as Integer '<<-- not used
If Boolean = True then '<<-- is "Boolean" a global variable or a control on the form??
checkbox.Enabled
Else
temPval = Dlookup("[Field Name]", "Table", "[Primary Key] = " & RecordNumber) ' <<-- where is the value for RecordNumber set????
checkbox.Enabled = True
checkbox = temPval
End if