Advertisement

07.15.2008 at 07:30AM PDT, ID: 23566193
[x]
Attachment Details

Make sure user selects item from list box before pressing edit.

Asked by linbayzak in Access Forms

Tags: , , ,

Hi Experts,
I want to make sure the user selects an item from the list box because if he/she does not, the debugger will pop up.  I want to make a message box pop up and tell the user they need to select an item before pressing the edit button.  How can I do that? Below is the code for the edit button click event. Thanks for all your help :-)

LauraStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
Private Sub cmbEdit_Click()
On Error GoTo Err_cmbEdit_Click
 
    
    
    If Me.lstSetupHistory.Column(4) = True Then
        DoCmd.OpenForm "frmSetupLogsheet", , , "ChangeoverEntry=" & lstSetupHistory, acFormEdit
    Else
        DoCmd.OpenForm "frmSetupLogsheetAnnealing", , , "ChangeoverEntry=" & lstSetupHistory, acFormEdit
    End If
    
    DoCmd.Close acForm, "frmSetupHistory"
 
    
Exit_cmbEdit_Click:
    Exit Sub
Err_cmbEdit_Click:
    MsgBox Err.Description
    Resume Exit_cmbEdit_Click
    
End Sub
[+][-]07.15.2008 at 08:01AM PDT, ID: 22007685

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Access Forms
Tags: Microsoft, Access, 2007, None
Sign Up Now!
Solution Provided By: koutny
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.15.2008 at 08:47AM PDT, ID: 22008110

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628