[AccessD] Some more Sat night code help please.

Joe Hecht jmhla at earthlink.net
Sun Nov 28 00:01:06 CST 2004


I wish that was my biggest problem. No worries.

JOE HECHT
LOS ANGELES CA 
 jmhla at earthlink.net

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jeremy Toves
Sent: Saturday, November 27, 2004 9:48 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Some more Sat night code help please.

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
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list