Senin, 14 Mei 2012

RE: [MS_AccessPros] DLookup vs Create recordset and get recordcount

 

Connie-

DLookup is just fine, as long as you're not calling it over and over in quick
succession. You just want to do one probe to the database – probably in the
Current event – so DLookup is the simplest way to go.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-------------------

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of mrsgoudge
Sent: Monday, May 14, 2012 10:20 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] DLookup vs Create recordset and get recordcount

 
Hi all,

On one of my forms I display a label if there is a related record in another
table. Is it best to use DLookup vs create recordset and get recordcount? Here
is what I currently have and I would like to know what is best:

'Display label re relationships entered if applicable
If Not IsNull(DLookup("ContactID1", "ContactsLink", "ContactID1 = " &
Me.ContactID & " Or ContactID2 = " & Me.ContactID)) Then
Me.lblRelEnt.Visible = True
Else: Me.lblRelEnt.Visible = False
End If

thanks!
Connie

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar