PLEASE help...syntax error

rupes_mahal

Registered User.
Local time
Today, 14:59
Joined
Aug 12, 2001
Messages
60
Hi...

Im running this code:

Private Sub SIscore_Click()

Dim strSQL As String

strSQL = "SELECT Bodysys from cal " _
& "WHERE Clin1sub = 'hello'"

Me!SIscore = strSQL

End Sub

What I want this code to do is to bring the 'Bodysys' back to thw SIscore field. But I am getting an error when this is run:

Run-time error '2113'

The value you entered isn't valid for this field.

WHAT AM I DOING WRONG.....PLEASE HELP.....IM REALLY LOSING IT HERE....

thankyou ion advance.

ruby
 
You can't run SQL in a field like that. What you want is to do a DLookup:
Me.ScreenFieldIWant = DLookup("[Name_of_Field_I_Want]", "MYTABLE", "[SOMEFIELDTHATIHAVE]= '" & Me.ScreenFieldIhave & "')
 

Users who are viewing this thread

Back
Top Bottom