Jeremy Toves
itsame2000 at sbcglobal.net
Sat Nov 27 23:47:49 CST 2004
Sorry about the duplicate email. I didn't realize the first email left my outbox. Jeremy Toves <itsame2000 at sbcglobal.net> wrote: A space is not null. If Me.cboEmpName.Value = " " Then Try this. If IsNull(Me.cboEmpName.Value) Then Joe Hecht wrote: Private Sub cmdEmpDetails_Click() ' Comments : Open Employee form mased on cboEmpName ' Parameters: - ' Modified : ' ' -------------------------------------------------- On Error GoTo Err_cmdEmpDatails_Click Dim strStDocName As String Dim strStLinkCriteria As String Dim lngRetval As Long Dim frmCurrentForm As Form There is a combo box with a button to open another form on this form. The combo box value is null when this form opens. If the user clicks the button I want to open the message box and say try again. The message box code is not fireing. Would someone see what is not working here? If Me.cboEmpName.Value = " " Then 'If combobox value is null open message box lngRetval = MsgBox( _ "Please pitck an employee from the list or click on the close buttob", _ vbOKOnly + vbCritical + vbSystemModal + vbDefaultButton1, _ "Please pick Employee") Select Case lngRetval Case vbOK Set frmCurrentForm = Screen.ActiveForm ' Keep selection box form as active form End Select Else strStDocName = "Employee" strStLinkCriteria = "[EmpID]=" & "'" & Me![cboEmpName] & "'" DoCmd.OpenForm strStDocName, , , strStLinkCriteria End If Exit_cmdEmpDatails_Click: Exit Sub Err_cmdEmpDatails_Click: MsgBox Err.Description Resume Exit_cmdEmpDatails_Click End Sub JOE HECHT LOS ANGELES CA jmhla at earthlink.net -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com