Message before next Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a subform that i would like to have a message prompt
appear to the end user before going on to the next record. It can be as
simple message but i am unsure where to begin. Can this be done through the
form?
 
What's the purpose of the "message prompt" and how are you navigating to the
next record?
 
The form is for data input of customers invoices. The purpose for having the
message prompt on the main form is so the users do not accidently move onto
the next record and key in data for another customer. The form consists of a
main form and subform and the record selector on the bottom of the form moves
onto the next customer. Some message like STOP DO YOU WANT TO CONTINUE TO
NEXT CUSTOMER. Can this be done?
 
I think this will do the job:

Private Sub Form_BeforeUpdate(Cancel As Integer)

Resp = MsgBox("DO YOU WANT TO CONTINUE TO NEXT CUSTOMER?", vbYesNo, "Stop!")
If Resp = vbNo Then
Cancel = True
End If

End Sub
 
Thanks but which text box is this placed into? I use the record selector in
the bottom of the form to advance to the next customer and the CustomerID
field is the primary key that changes when going onto the next customer. I
tried this code in the field but no message and still able to go to the next
record.
 
HI jk,

I don't think this goes in a textbox - as the code reads - its the Forms
'Before Update' event - so it goes into the forms module...

HTH

Corey
 
Hello Corey,

I have tried forms before update but still no message box. The only reason i
tried the code in the CUSTOMERIS primary key field is that is what changes
when you go forward with the record selector since it indicates a new
customer so i believe this is considered a before update event ..right?
 
I assumed that you wanted the warning in case your user started entering data
on one customer and then went to another customer without thinking and
continued entering data meant for the original customer. My code will only
work *IF* you've actually entered data in the original record *THEN* moved to
another record.

If you want the warning anytime you move from one record to another, the only
practical way, I think, would be to replace the native navigation controls
with custom controls, and this would make navigating thru records for viewing
purposes very tiresome!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
missinglinq via AccessMonster.com said:
I assumed that you wanted the warning in case your user started entering
data
on one customer and then went to another customer without thinking and
continued entering data meant for the original customer. My code will only
work *IF* you've actually entered data in the original record *THEN* moved
to
another record.

If you want the warning anytime you move from one record to another, the
only
practical way, I think, would be to replace the native navigation controls
with custom controls, and this would make navigating thru records for
viewing
purposes very tiresome!

How about using the form's current event? Agreed it would be a major PITA
for the user though.

Keith.
www.keithwilby.com
 

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

Back
Top