Form set to Data Entry = Yes

J

Jane

Hello

I have a popup form with just 3 controls and it is set to data entry so that
it open blank ready for the new record.

After the 3 control have been typed into it then goes to a new record.

Is it possible after the 3 controls are complete, to have a message come up
and say you have completed the form, would you like to create another record
or close the form.

Thank you for any help you can give with this problem

Jane Hollin
 
L

Lynn Trapp

You can add something like this to the BeforeUpdate event of your form.

If MsgBox("You have completed this record, do you want to enter another
record?", vbYesNo) = vbNo Then
DoCmd.Close
End If
 
J

Jane

Thank you for the help.

I put the code as you said on the form
If I select No (I don't want to create another record) the details just
typed in do not save
But if I select yes then close th form without typeing in a 2nd record the
1st does save.

Is there a way to save the record just typed in without going to a new blank
record first.

Sorry for all the questions by the way
 
L

Lynn Trapp

I'm sorry Jane... just move the code to the AfterUpdate event of the form and
it should be good.

No problem with all the questions. That's what we are here for
 
J

Jane

Thank you for your help. I fully understand that the experts in this forum
are not paid and I would like to say that I personaly value the help everyone
gives.

I have altered the question to say
You have completed the new record. Do you want to save the details.

The yes click work really well with your code
How would I delete the new record (the details just typed in) if they select
No.

Thank you again
 
L

Lynn Trapp

Jane,
That's a situation where you MUST use the BeforeUpdate event and if they
answer No, you set the Cancel parameter to true.
 

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

Top