Selasa, 11 Maret 2014

[MS_AccessPros] VBA to a Macro?

 


Hi,

 

Is there a way to convert the following code to a Macro?  I have an mde and lost all the VBA funcationality.

Private Sub DOB_AfterUpdate()

Dim ln As String

Dim fn As String

Dim lsname As String

Dim dobth As Date

Dim varx As String

Dim mes As String

Dim nam2 As String

dobth = Me!DOB

varx = Format(dobth, "dd-mmm-yy")

lsname = Me!Lname

nam2 = " And [fname] = '" & Me!Fname & "'"

 

ln = DLookup("[lname]", "Members", "[Members].[DOB] = # " & varx & " #")

fn = DLookup("[fname]", "Members", "[Members].[DOB] = # " & varx & " #")

 

If Not IsNull(DLookup("[DOB]", "Members", "[Members].[DOB] = # " & varx & " #" _

& " And [Lname] = '" & lsname & "'" & nam2)) Then

mes = MsgBox("Possible duplicate Applicant", vbOKOnly)

 

End If

End Sub

 

Regards

Toukey

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
.

__,_._,___

Tidak ada komentar:

Posting Komentar