[AccessD] Open a form and find a record

Hale, Jim Jim.Hale at FleetPride.com
Mon Oct 18 13:52:23 CDT 2004


How about seek? Would that work here?
Jim

-----Original Message-----
From: Nicholson, Karen [mailto:cyx5 at cdc.gov]
Sent: Monday, October 18, 2004 1:32 PM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Open a form and find a record


OK.  I am doing the same thing to open a form and determine pretty much
the same kind of filter.  I get queezy using dlookups and was trying to
find a better way, not using dlookups, to achieve the same
functionality.  I was under the assumption that using dlookups is a nono
as other programs do not understand them (in the event I upgrade to
VB.net) and dlookups are slow.  Any other suggestions beside the old
dlookup method?

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mcgillivray,
Donald [ITS]
Sent: Monday, October 18, 2004 2:23 PM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Open a form and find a record


Susan,

Try something like:

(air code)

	Dim stDocName As String
	Dim stLinkCriteria As String

	If Nz(Dlookup("[ProjectID]","tblProjects","[QAFName]='" &
Me![UsersName] & "'"),"NotFound") = "NotFound" Then
		MsgBox "You are not the QA on any projects."
	Else
		stDocName = "frmProjects"	
		stLinkCriteria = "[QAFName]=" & "'" & Me![UsersName] &
"'"
		DoCmd.Close 'Closes the menu form.
		DoCmd.OpenForm stDocName, , , stLinkCriteria
	End If

Just substitute your actual field and table names in the dlookup
function.

HTH,

Don McGillivray


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

***********************************************************************
The information transmitted is intended solely for the individual or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of or taking action in reliance upon this information by
persons or entities other than the intended recipient is prohibited.
If you have received this email in error please contact the sender and
delete the material from any computer. As a recipient of this email,
you are responsible for screening its contents and the contents of any
attachments for the presence of viruses. No liability is accepted for
any damages caused by any virus transmitted by this email.


More information about the AccessD mailing list