Message before next Record

J

jk

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?
 
M

missinglinq via AccessMonster.com

What's the purpose of the "message prompt" and how are you navigating to the
next record?
 
J

jk

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?
 
M

missinglinq via AccessMonster.com

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
 
J

jk

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.
 
C

Corey-g via AccessMonster.com

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
 
J

jk

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?
 
M

missinglinq via AccessMonster.com

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!
 
K

Keith Wilby

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
 
Top