Manipulating SubForms Via Code

  • Thread starter Thread starter nouveauricheinvestments
  • Start date Start date
N

nouveauricheinvestments

Hi,

I have a subform with three fields: ID, Current(boolean), and Issue.
On my parent form, I have a button that says OK. I want to put a
select case statement in this OK_Click event to check to make sure my
boolean field is checked. If it isn't checked, then I will give the
user a message box that says, 'Please check the checkbox to validate
this is a new current issue'.

This is what I have tried.

select case ParentForm.Subform.Form.CurrentRecord

More or less, I'm not sure how to access this one field in code.

Thanks for your help.
 
As an example;

Private Sub cmdOK_Click()

If Me.NameOfYourSubformControl.Form!chkCurrent = False Then
MsgBox "Please check the Current checkbox"
Exit Sub
End If

End Sub
 
As an example;

Private Sub cmdOK_Click()

If Me.NameOfYourSubformControl.Form!chkCurrent = False Then
MsgBox "Please check the Current checkbox"
Exit Sub
End If

End Sub

Perfect. It works wonderfully.
 
Back
Top