[AccessD] IsDirty

Gustav Brock gustav at cactus.dk
Tue Aug 17 10:51:36 CDT 2004


Hi Virginia

Looks like you need to read up how to reference subforms etc.:

http://www.databaseadvisors.com/newletters/newsletter032004/0310ReferenceGuide/SyntaxForSubs.htm

/gustav


> I am having problems on the close button of my form. I want to make sure
> certain fields are completed before they close the form. I am trying to use
> IsDirty so the form closes if there hasn't been any changes made and also if
> all the fields have been completed. I am using the below code and receive
> the error, object not supported. This is a form/subform and the close button
> is on the subform. If I remove the IsDirty, it works.

>  If Forms!frmEvalMain.frmEvalSub.Dirty = True Then    'Data Entered?  Yes
>     If Len(TypeID & "") = 0 Then
>        MsgBox "You must enter a Type." & vbCrLf, vbCritical, " Entry
> Required"
>        TypeID.SetFocus
>     ElseIf Len(Title & "") = 0 Then
>       MsgBox "A title must be entered." & vbCrLf, vbCritical, " Entry
> Required"
>       Title.SetFocus
>     ElseIf Len(Author & "") = 0 Then
>        MsgBox "An Author must be entered." & vbCrLf, vbCritical, " Entry
> Required"
>        Author.SetFocus
>         Else
         
>          response = MsgBox("Do you want to Exit?", vbYesNo + vbQuestion,
> "Exit")
>          If response = vbNo Then
>            Title.SetFocus
>          Else
>              DoCmd.RunCommand acCmdSaveRecord
>             DoCmd.Close acForm, "frmEvalMain"
>          End If
>       End If 

>  Else
>    DoCmd.Close acForm, "frmEvalMain"
>  End If

 

> Virginia




More information about the AccessD mailing list