I am getting this error message "Method 'Form' of object '_SubForm' failed", when my code On Current runs (see code below), when I click on cmdGrowth (which opens another form-Growth) and when I click on the close button for the Growth form. Prior to today this functioned fine. I was making some coding changes today, but not anything having to do with this section of code or the cmdGrowth button (at least as far as I am aware-I got kind of deep into it, so I am not able to completely retrace my tracks). I cannot find reference to this error message anywhere. Can someone please help me make sense of the error message and maybe look at my code to see if there is something there that I am missing? Is it possible my Growth form got corrupted somehow in what I was doing? Any ideas would be appreciated!
Thank you,
Kristen
Private Sub Form_Current()
On Error GoTo Form_Current_Err
'When ClientInfo is not a new record, run the following code
If Me.NewRecord = False Then
' Synchs FindName and current record
Forms!frmClientInfo!cboFindName = Forms!frmClientInfo!ClientID
'If Program = Pregnant Woman, cmdGrowth.enable = false
'and DueDate.visible = true
If Me!frmEnrollment.Form!Program = "Pregnant Woman" Then
Me!cmdGrowth.Enabled = False
Me!DueDate.Visible = True
'Otherwise cmdGrowth.enable = true and DueDate.visible = false
Else
Me!cmdGrowth.Enabled = True
Me!DueDate.Visible = False
End If
End If
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
End Sub
Thank you,
Kristen
Private Sub Form_Current()
On Error GoTo Form_Current_Err
'When ClientInfo is not a new record, run the following code
If Me.NewRecord = False Then
' Synchs FindName and current record
Forms!frmClientInfo!cboFindName = Forms!frmClientInfo!ClientID
'If Program = Pregnant Woman, cmdGrowth.enable = false
'and DueDate.visible = true
If Me!frmEnrollment.Form!Program = "Pregnant Woman" Then
Me!cmdGrowth.Enabled = False
Me!DueDate.Visible = True
'Otherwise cmdGrowth.enable = true and DueDate.visible = false
Else
Me!cmdGrowth.Enabled = True
Me!DueDate.Visible = False
End If
End If
Form_Current_Exit:
Exit Sub
Form_Current_Err:
MsgBox Error$
Resume Form_Current_Exit
End Sub