Mind if I comment?
Remove the code from the Sub RiskAssesment_Click() event altogether. The only code you need is in the Form_Current() event. Add the code there as follows:
Code:
rs!Risk.Visible = Me.RiskAssessment
As Missinglinq pointed out, make sure you spell it consistently. Of course you have to open the table there in order to access the data. You also need the same code in the Sub RiskAssesment_Update() event.
However, I'm confused about something altogether different. Your VBA code is accessing rs!RiskAssesment, etc., but there's no code pointing to a record. Your cursor is still at BOF() (beginning of file), and is not pointing to any data at all.
Also, the code
Code:
If rs.RiskAssesment = False Then
rs.Risk.Visible = False
rs.Risk1.Visible = False
rs.RiskText.Visible = False
rs.Risk1text.Visible = False
rs.RiskButton.Visible = False
ElseIf rs.RiskAssesment = True Then
rs.Risk.Visible = True
rs.Risk1.Visible = True
rs.RiskText.Visible = True
rs.Risk1text.Visible = True
rs.RiskButton.Visible = True
rs.Update
is almost completely redundant. All you need is
Code:
rs.Edit (which you also don't have anywhere in the presented code snippet)
rs!Risk.Visible = rs!RiskAssesment
rs!Risk1.Visible = rs!RiskAssesment
rs!RiskText.Visible = rs!RiskAssesment
rs!Risk1text.Visible = rs!RiskAssesment
rs!RiskButton.Visible = rs!RiskAssesment
rs.Update
Dataset fields are delineated by "!", not ".", so you should have, for example,
Code:
rs!Risk.Visible = rs!RiskAssesment
"." is used to delineate methods (such as ".Update") or properties (such as ".Visible"), not field names.
Also, the whole snippet looks suspicious to me. Are using "rs." to refer to the form, and not the dataset? The form object is identified by "Me", not by the table object's name.
By the way, what is the real name of the table? Using reserved words such as "Database" as part of an object's name is just begging for trouble. Access has its own meaning for those words, and couldn't care less how the programmer means it.
Good luck,
Sam