Senin, 27 Maret 2017

Re: [MS_AccessPros] Generic User Experience Question

 

David-

You should be checking that the list boxes contain values before doing an insert or delete.  Enabling / disabling the command buttons is also a good idea, but you should perform the IsNull tests in any case.

John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications

On Mar 28, 2017, at 01:35, david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I have several forms which the user must navigate in order to "configure" my application for his particular facility.  All the forms are unbound and have 2-3 cascading list boxes.  Each list box has two command buttons next to it.  One button for adding a record and one for deleting a record. 

All was good until I found that if the DELETE button was clicked with no record selected in the list box, it throws an error.  Similarly, if the ADD button on a child list box is clicked when no record is selected in the Parent list box, an attempt is made to create a record with nothing entered in the foreign key field (which I have intentionally disabled).

Is there a "best way" to handle this?  Should I disable/hide the buttons until the list box is clicked on? Or should I trap that event and put up a message box?  I think code for disabling the buttons will be a little simpler but I wanted to get advice from ones who have created many different applications.


__._,_.___

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 (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar