[AccessD] Open a form and find a record

Mcgillivray, Donald [ITS] donald.a.Mcgillivray at mail.sprint.com
Mon Oct 18 13:23:21 CDT 2004


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





More information about the AccessD mailing list