Selasa, 11 Maret 2014

Re: [MS_AccessPros] VBA to Macro?

 

Toukey-


If you inherited an mde, where did you get the code?  You can't define a macro in an mde, either.

Yes, it would be possible to convert to a macro, but why?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Mar 11, 2014, at 9:39 PM, toukey1 <no_reply@yahoogroups.com> wrote:

Is it possible to create a macro from the following VBA code?  Inherited an .mde database and unable to use VBA. 
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

 

Thanks
Toukey

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

__,_._,___

Tidak ada komentar:

Posting Komentar