Subform2 and DataEntry=false

C

Chris

Help! I cannot see why this won't work.

At my user's new client entry they have available a button they can click
with code to abandon their current entry.

The parent form, subform1 (Bookingfrm) and subform2 (BCfrm) all get data
during a complete entry. Since the user (only when clicking the button) will
abandon the entry and the tables are related with cascading deletes, all
traces should be gone when done. When the user makes an entry to the parent
and non-[Bookingfrm] subform, no surprises. However, should the user never
get to the [Bookingfrm] or [BCfrm] the code throws an error stating a record
is required. My delete code follows:

'DELETES RECORD and RELATED
If Me.Dirty Then
Me.Undo
End If

If Not Me.NewRecord Then
RunCommand acCmdDeleteRecord
End If

Just ahead of the above code is code setting subforms back to data
entry=false. Note that the client entry form and [Bookingfrm] subforms are
always data entry types.

Of the following two lines, the error about the required record goes to the
second line.

Forms![frm1 cliententry].Form![CCfrm].Form.DataEntry = False
Forms![frm1 cliententry].Form![Bookingfrm].Form![BCfrm].Form.DataEntry = False


I have tried to save the record and even force an entry so the user won't
have to...I just can't get there from here with my limited experience --
virtually none!

Is there help for me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Toggle DataEntry Programatically 3
tabbed subform related new record. 11
set focus 2
delete subform record 2
Data Entry property keeps setting to False 13
Message appears twice. 4
delete code, subform 1
Blank subform 0

Top