Kamis, 11 Desember 2014

Re: [MS_AccessPros] Re: User clicks the X (close) button on a form in the upper-right hand corner and it closes.

 

Norbert-


I would think you need to figure out what causes the loop.  Can you hit CTRL+Break to break into the code when this happens?

As for trapping, use the Form_Unload event to figure out when a blank record has been left on the form and either Cancel the Unload (which keeps the form from closing) or try to delete at that point.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Dec 11, 2014, at 2:45 PM, drnorbert@msn.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John,

The form has a Close cmd which works fine.

Sometimes for whatever reason the form may gets stuck in a loop, this issue it happens not often however the only way to close the form is by using the X.

When this happen if the user started input data then the form is saved with a new ID.

When this form is opened it creates a unique MasterFileNo (is in not  an auto Increment Identity (SQLI)) therefore when the user closes with X then is an empty record.

I want to delete this empty record if by any chance the user clicks the X and the fields are not filled properly such as Client Name, Address, etc.

I designed all the conditions in the cmdClose button close event however this conditions are not trigger when the user close the form clicking on X.


Let me know if makes sense please.


Regards

Norbert  


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

.

__,_._,___

Tidak ada komentar:

Posting Komentar