<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>
<META content="MSHTML 5.00.3314.2100" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=140064514-30012003>It
seems to have something to do with the status criteria.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=140064514-30012003></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=140064514-30012003>If I
take out the, AND [StatusID] = 1....</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=140064514-30012003> and just use <FONT color=#0000ff face=Arial
size=2><SPAN class=140064514-30012003>stLinkCriteria = "[EngineerID]=" &
Me![UserID] </SPAN></FONT></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=140064514-30012003><FONT
color=#0000ff face=Arial size=2><SPAN
class=140064514-30012003></SPAN></FONT></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=140064514-30012003><FONT
color=#0000ff face=Arial size=2><SPAN class=140064514-30012003>then it works. Do
I have the stLinkCriteria where it checks the status code
wrong?</SPAN></FONT></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=140064514-30012003><FONT
color=#0000ff face=Arial size=2><SPAN
class=140064514-30012003></SPAN></FONT></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=140064514-30012003><FONT
color=#0000ff face=Arial size=2><SPAN
class=140064514-30012003>Virginia</SPAN></FONT></SPAN></FONT><FONT color=#0000ff
face=Arial size=2><SPAN
class=140064514-30012003> <BR>
</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Mike and Doris Manning
[mailto:mikedorism@ntelos.net]<BR><B>Sent:</B> Thursday, January 30, 2003 8:36
AM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B> RE: [AccessD]
Don't Want form to open<BR><BR></DIV></FONT>
<DIV><SPAN class=293013214-30012003><FONT color=#0000ff face=Arial
size=2>Me![UserID] is taken into account. Virginia builds it into
the stLinkCriteria variable. The real problem is that DCount returns a
<U>count of records</U> matching stLinkCriteria. She was always getting
the error message because unless you explicitly tell an IF..THEN
statement how to evaluate the results then it assumes you are working
with a boolean and in this particular case, the value was not and never would
= TRUE.</FONT></SPAN></DIV>
<DIV><SPAN class=293013214-30012003><FONT color=#0000ff face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=293013214-30012003>
<DIV align=left><FONT face=Arial size=2>Doris Manning</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Database Administrator</FONT></DIV>
<DIV align=left><FONT face=Arial size=2>Hargrove Inc.</FONT></DIV>
<DIV align=left><FONT color=#0000ff face=Arial
size=2><U>www.hargroveinc.com</U></FONT></DIV></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV align=left class=OutlookMessageHeader dir=ltr lang=en-us><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
accessd-admin@databaseadvisors.com
[mailto:accessd-admin@databaseadvisors.com] <B>On Behalf Of </B>Arthur
Fuller<BR><B>Sent:</B> Thursday, January 30, 2003 09:22 AM<BR><B>To:</B>
accessd@databaseadvisors.com<BR><B>Subject:</B> Re: [AccessD] Don't Want
form to open<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Your test fails to take Me![UserID] into
consideration, which means that DCount() will always return non-zero as long
as there are rows in said table. You need to carry the test down to the
Dcount() line.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>hth,</FONT></DIV>
<DIV><FONT face=Arial size=2>Arthur</FONT></DIV>
<BLOCKQUOTE dir=ltr
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:HollisVJ@pgdp.usec.com"
title=HollisVJ@pgdp.usec.com>Hollis,Virginia</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:'accessd@databaseadvisors.com'"
title=accessd@databaseadvisors.com>'accessd@databaseadvisors.com'</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, January 30, 2003 8:55
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [AccessD] Don't Want form to
open</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2><SPAN class=590144613-30012003>I have been
off the list for awhile - you sure have gotten fancy with subscribing the
last few months!!</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=590144613-30012003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=590144613-30012003>***********</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=590144613-30012003>Problem:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=590144613-30012003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=590144613-30012003>I have a form
that users select their name from a combobox, it opens a main form
that allows them to edit only active requests. I am having problems
with the main form opening even if they do not have any active requests
(they are closed). If they do not have any active requests, the message
box "No Open EFRs" should display, but it doesn't, the frmSystemFailure
opens & I receive an error, can't go to specified record (on the main
form OnOpen, I have it set focus to a certain field).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=590144613-30012003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=590144613-30012003>How can I
prevent the frmSystemFailure from opening & display the message?
</SPAN></FONT><FONT face=Arial size=2><SPAN
class=590144613-30012003>UserID is the name of the
combobox.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=590144613-30012003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=590144613-30012003> 'Status
is Pending, In Progress, or In Review, and User ID = Engineer
ID<BR> stDocName =
"frmSystemFailure"<BR> stLinkCriteria = "[EngineerID]="
& Me![UserID] & " AND [StatusID] = 1" &
_<BR> "Or [EngineerID]=" & Me![UserID] & " AND
[StatusID] = 2" & _<BR> "Or [EngineerID]=" &
Me![UserID] & " AND [StatusID] =
4"<BR>
<BR> ' Check whether the user has any EFRs open. If they
do, open the<BR> ' form with a filter.<BR>On Error
Resume Next<BR> If DCount("EngineerID", "tblEngineer",
stLinkCriteria) Then<BR>
DoCmd.OpenForm stDocName, , , stLinkCriteria<BR>
Else<BR> 'Display Message "No
open EFRs"<BR> MsgBox "No open
EFRs for " &
Forms![frmUpdateEFRs]![UserID].Column(1)<BR> End
If</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=590144613-30012003> ' Close the dialog
box.<BR> DoCmd.Close acForm,
"frmUpdateEFRs"</SPAN></FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>