build function to lookup a number mltple flds

Microsoft Office access 2003 - upgrade
December 10, 2010 at 17:15:12
Specs: Windows XP, 512MB

i'm bldg (or i think so) a function to lookup the number corresponding to an option selected in a combo box on a form. There are at least 64 such fields and, apparently, writing a dlookup proc for all of them would make code messy and a lot bigger..

Here's the code I have, and the error that I get when I call the function from an afterupdate event of a field is "Expected variable or procedure, not module"

Function LkupScore()

Dim str1, str2, strwhere As String
Dim ctrl1 As Control

str1 = ActiveControl.Value
str2 = ActiveControl.Name
ctrl1 = "S" & str2

strwhere = ("[parameter] = '" & str1 & "') AND ([frmprmnme] = '" & str2 & "'")

ctrl1.Value = DLookup("[score]", "score", strwhere)

End Function

Thanks for any help.

See More: build function to lookup a number mltple flds

Report •

December 10, 2010 at 19:18:54
sum1 on the west coast prbbly... still pretty hopeful for a reply... :-)


Report •
Related Solutions

Ask Question