Dcount in ADP (1 Viewer)

bbrendan

Registered User.
Local time
Today, 23:11
Joined
Oct 31, 2001
Messages
35
Hi All,

Im working on a ADP database but cannnot get the Dcount() to work.
This is the existing vb
-----------------------------------------------------------------------------
If DCount("[filename]", "w_imp_import_history", "[filename]=forms!frm_import!txt_filename") Then
Beep
MsgBox "Error Filename Duplication!" & _
vbCrLf & _
vbCrLf & _
"The filename [" & txt_fileName & "] has already been imported!", vbCritical, "File Duplication"

----------------------------------------------------------------------------
When I try and run this throu an ADP it wont run

anyone got an idea on how to get around this???

thanks
 

Fuga

Registered User.
Local time
Tomorrow, 00:11
Joined
Feb 28, 2002
Messages
566
Sorry, I don´t understand.

IF what?

Fuga.
 

bbrendan

Registered User.
Local time
Today, 23:11
Joined
Oct 31, 2001
Messages
35
Hi Fuga,

what I do with this qry is a
DLookup against a table, so if the filename exists already in the table a msgbox appears saying this filename already exists.

It stops me from adding duplicate entries into my import program

thanks
 

Stafford

Registered User.
Local time
Today, 18:11
Joined
Aug 20, 2002
Messages
23
Bbrendan

Check out this thread, Jon K helped me with this and I have since modified his code to help with so many forms

Find Dupe Code

I hope this is what you are after.
 

Fuga

Registered User.
Local time
Tomorrow, 00:11
Joined
Feb 28, 2002
Messages
566
Don´t you need an operator or something? Just a thought, I´m not used to dcount. (Or any other programming for that matter):p

I would have thought you needed something like this

IF Dcount(......) > 0 THEN.....


But then again, I´m not used to theese things.

Fuga.
 

pono1

Registered User.
Local time
Today, 15:11
Joined
Jun 23, 2002
Messages
1,186
Code:
If Not IsNull(DLookup("[filename]", "w_imp_import_history", "[filename]='" & Forms!frm_import!txt_filename & "'")) Then
 MsgBox "Your warning, etc"
End If

Regards,
Tim
 

Users who are viewing this thread

Top Bottom