TOracleNavigator behavior

mrmitch

Member
I'm using a standard TOracleNavigator control on my data entry form and I noticed that while in Edit mode, the EnterQBE button is highlighted. If the EnterQBE button is pressed while in edit mode, the data is automatically posted. I would like to prompt the user to save the changes before starting QBE but not prompt for all other post operations. I can't come up with an elegant solution. What would be the easiest way to test that?

I have this in the BeforePost method of the DataSet:
if LastPressed = nbEnterQBE then begin
if MessageDlg('Would you like to save changes before initiating query mode?',mtConfirmation,[mbYes,mbNo],0) mrYes then begin
Abort; // raises silent exception
end;
end;

This is the closest I could come except when the user selects "No", the exception doesn't put them in QBE Mode. It puts them back into edit mode.

Any other simple solutions?
 
I think this is the most elegant way. Better solutions than this would require an additional event for the TOracleDataSet. I have tried the OnClick and BeforeAction events of the navigator, but this doesn't provide a solution either.

------------------
Marco Kalter
Allround Automations
 
Back
Top