General information
Category:
Coding, syntax & commands
>ThisForm.KeyPress:
>If nKeyCode = -7 && F8
> MessageBox("Value: "+ThisForm.TextBox.Value)
> MessageBox("Table.Field: "+Table.Field)
>EndIf
Like Trey said, nothings been written to the field yet, thats an advantage so you can cancel the change by hitting Esc without needing to revert the record anythign.
Two traps with this methodology however, is that if you use a toolbar button to do something things, you have to remember that Toolbars don't recieve focus, so if you access Table.Field from the toolbar, it still may not reflect the changes in teh textbox.
And the other one is, try refresh()ing the form when the hit F8. Since the TB value is differnet than the field value, the Refresh() will set the TextBox BACK to the field value because it has'nt been committed yet.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only