A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

# Error in Forms



 
 
Thread Tools Display Modes
  #1  
Old December 31st, 2008, 04:21 PM posted to microsoft.public.access.forms
mccoy
external usenet poster
 
Posts: 32
Default # Error in Forms


I get a red # Error message that flashes in the upper right hand side of the
form.

the text within it reads:

=IIf(DCount("*","[Contacts Extended]","[ID]" & Nz([Clinic ID],0) & " And
[Contact Name] = '" & Replace(Nz([Contact Name]),"'","''") & "'")0,"Possible
Duplicate","")

It also seems to be making things "unstable" i.e. screen freezes up etc.

Any help is greatly appreciated.

--
mccoy
  #2  
Old January 1st, 2009, 07:25 AM posted to microsoft.public.access.forms
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default # Error in Forms

Hi,

Usually that means a function is choking on something. Or that a the
name of a variable or column is not spelled correctly. It may not make a
difference--modify the Nz([Contact Name]) to Nz([Contact Name],""). If that
does not help remove the code from the field for the time being and add a
button to your form and add an On Click event procedure to the button. In
the procedure do:

Dim lngCount As Long

On Error Resume Next

lngCount = DCount("*","[Contacts Extended]","[ID]" & Nz([Clinic ID],0) & "
And
[Contact Name] = '" & Replace(Nz([Contact Name], ""),"'","''") & "'")
If Err.Number = 0 Then
MsgBox "Count = " & lngCount & "."
Else
MsgBox "Error " & Err.Number & ": " & Err.Description & "."
Err.Clear
End if

Do a test on a record where the problem occurs. Click the button and
see what happens. Do you get a count or an error? If you get an error break
it down further by assigning parts of the formula to variables and adding in
more error checking and try again.

Clifford Bass

"mccoy" wrote:


I get a red # Error message that flashes in the upper right hand side of the
form.

the text within it reads:

=IIf(DCount("*","[Contacts Extended]","[ID]" & Nz([Clinic ID],0) & " And
[Contact Name] = '" & Replace(Nz([Contact Name]),"'","''") & "'")0,"Possible
Duplicate","")

It also seems to be making things "unstable" i.e. screen freezes up etc.

Any help is greatly appreciated.

--
mccoy

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.