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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
# 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
|
|||
|
|||
# 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 | |
|
|