hi,
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"
Thanks in advance...
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"
Code:
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 in advance...