Jeremy Toves
Itsame2000 at sbcglobal.net
Sat Nov 27 23:43:54 CST 2004
You are looking for a space and not a null. They aren't the same thing.
If Me.cboEmpName.Value = " " Then
Try this.
If IsNull(Me.cboEmpName.Value) Then
Thanks,
Jeremy
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Joe Hecht
Sent: Saturday, November 27, 2004 11:27 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Some more Sat night code help please.
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