Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 15th, 2003, 02:59 AM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default combo boxes

hi,

i have a combo box and a submit button. user will select a record in the combo box and click on the submit button to proceed on further.
how do i check if the user did not select any values for the combo boxes and click on the submit button???

how do i prompt a error msg if user does that??

pls advice!!
nono:D

  #2 (permalink)  
Old October 15th, 2003, 09:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oxford, , United Kingdom.
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nono

Philosophical point first - The question is not 'How do I tell the user they have done something wrong', the question is 'How do I stop the user doing the wrong thing?'

In this case you need to disable the submit button until the user has selected something from the combo box.

Assuming the Submit button is disabled in the form design, that the button is called btnSubmit and the combo box is called cmbChoice, you'll need to place the following code in the combo box's AfterUpdate event:

If nz(me.cmbChoice,0)<>0 then
    me.btnSubmit.enabled=true
else
    me.btnSubmit.enabled=false
End If


Brian Skelton
Braxis Computer Services Ltd.
  #3 (permalink)  
Old October 15th, 2003, 09:00 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

great!

thanks! it works!



Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Boxes nbuckwheat Access 1 January 15th, 2006 09:26 AM
3 combo boxes ttkt Beginning PHP 0 July 2nd, 2005 02:20 PM
Combo boxes socoolbrewster Access 1 March 4th, 2004 09:28 AM
Combo Boxes tjs206 VB Databases Basics 2 December 10th, 2003 05:20 PM
Combo Boxes Louisa Beginning VB 6 2 September 10th, 2003 09:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.