Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Warning message when updating info in DAP

Status
Not open for further replies.

Techniproshop

Programmer
Apr 24, 2007
50
0
0
CA
I'd like to add a warning message to my DAP (SAVE/DISCARD) and ask the user if he wants to save the changes he made or discard. There is already an automatic message, can I custom it?

Thanks.
 
on the before update event use..
try
dim result as boolean
result = msgbox "Do you wish to Save changes?",vbyesno
if result = vbyes then
'save the changes
else
' discard the changes ie undo
endif

hope this helps

Ian Mayor (UK)
Program Error
Programming is 1% coding, 50% error checking and 49% sweat as your application bombs out in front of the client.
 
I don't want to warn the user for each field he will change. I just want to confirm before the record is saved or the user go to another record. So where do I put the code for the entire record, i.e. not just for a control? under MSODSC in the script? There is no beforeupdate options there.
 
The beforeupdate event of the MSODSC property was added in the XP web components. Do have version 2000? Then it will not be available.
 
Create a command button on your DAP WITHOUT using the Wizard. If the Wizard appears, CLOSE IT IMMEDIATELY. Then on the onclick event, you can put something like the following; NOTE: If they decide not to save the record, blank out the updated fields, ESPECIALLY the primary key.

<SCRIPT language=vbscript event=onclick for=SaveConfirm>
<!--
Dim answer
answer = MsgBox ("Are you sure you want to Save the record?", vbYesNo, "Save Record?")
If answer = vbYes Then
MSODSC.DataPages(0).Save
Else
EmployeeID.value = ""
End If
-->
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top