They come from two fields - sorry it wasn't clear from the mail (it looked ok, when I typed them in).
In the meantime I struggled togather a code (taking everything from newsgroups here) that does this, (I had a parameter in the query which created further complications).
------------------------------------------------------------------------------------------
Public Function ConcRec()
Dim strOutput As String
Set QD1 = CurrentDb.QueryDefs!Model_Instrument_for_Equation
QD1.Parameters![InstrumParam] = Forms![Main]![Instrument].Value
QD1.Parameters![CompetencyParam] = Reports![Model_Instrument]![CompetencyName].Value
Set RecSource = QD1.OpenRecordset
Do While Not RecSource.EOF
If RecSource.Fields("WeightedScale").Value > 0 Then strOutput = strOutput & "+" Else strOutput = strOutput & "-"
strOutput = strOutput & RecSource.Fields("WeightedScale").Value
RecSource.MoveNext
Loop
Set RecSource = Nothing
If strOutput = "" Then strOutput = "+No equation can be generated"
ConcRec = Mid(strOutput, 2, Len(strOutput) - 1)
End Function
------------------------------------------------------------------------------------------
Thank you for your help.
Could you tell me why did I always get an error message "user defined type not defined" when I add the following line? Everybody seems to use it in their code, I know this must be Lesson1 topic, but what am I doing wrong?
Dim db as Database
Thanks for the help again.
SWK
[This message has been edited by SunWuKung (edited 07-23-2001).]