Unfortunately, Toukey, to my knowledge you can't unless the update function is handled by Excel. I've not ever needed to try to get Excel to recognize when an Access form updates a record. I'm sorry. If the update function is transferred to Excel, then Excel can do a follow-up to execute the code below.
From: "toukey1" <no_reply@yahoogroups.com>
To: "MS Access Professionals" <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, March 11, 2014 8:08:08 PM
Subject: Re: [MS_AccessPros] VBA to Macro?
To: "MS Access Professionals" <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, March 11, 2014 8:08:08 PM
Subject: Re: [MS_AccessPros] VBA to Macro?
Hi Jeff,
I am trying to get the following code on the "AfterUpdate" function on a field. Could that be done with Excel?
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
__._,_.___
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (17) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar