Run time error 3078 (1 Viewer)

ZeidHaddad

Registered User.
Local time
Today, 01:35
Joined
Oct 29, 2019
Messages
44
Hello everyone, hope everything is good!

I have this code
Private Sub Vertragsnummer_AfterUpdate()
Dim NewVertragsnummer As String
Dim stlinkcriteria As String
NewVertragsnummer = Me.Vertragsnummer.Value
stlinkcriteria = "[NewVertragsnummer] = " & "'" & NewVertragsnummer & "'"
If Me.Vertragsnummer = DLookup("[Vertragsnummer]", "Tbl_Dokumentation", stlinkcriteria) Then

MsgBox "The Contract Number," & NewVertragsnummer & ", Already exists!!" _
& vbCr & vbCr & "Please Check The Contract Number Again.", vbInformation, "duplicate information"

Me.Undo
End If

End Sub
I’m trying to avoid duplication inside my database but it keeps telling me that “tbl_dokumentation” does not exist! Although i have it.
Also for my form the data source is also the table documentation.
 

June7

AWF VIP
Local time
Today, 00:35
Joined
Mar 9, 2014
Messages
5,468
If you are trying to pull value from field Vertragsnummer, why does criteria reference field [NewVertragsnummer]? Is there really a field by that name?

If you want to provide db for analysis, follow instructions at bottom of my post.
 

ZeidHaddad

Registered User.
Local time
Today, 01:35
Joined
Oct 29, 2019
Messages
44
I got to be honest with you i was following the steps of a video, i’m still a beginner!
And no there’s no field with the name newVertragsnummer? I’m not really what I’m supposed to put in the criteria reference field!
Btw thanks for the fast reply!
 

Users who are viewing this thread

Top Bottom