infamous runtime 13 error

S

sacklin

I get the Runtime 13 error on this line of code:
========================================
holdstring = "[Course] = ' " & holdCourse & " ' " And "[ssbsect_term_code] =
' " & holdTerm & " ' "
========================================
Course is text field
ssbsect_term_code text field
both are in a linked Oracle table
I do get the same error if I move everything to a local access table.
holds are variables in my code
=========================
If I do just one check, ie:

holdstring = "[Course] = ' " & holdCourse & " ' "

then all is ok ... it only generates the runtime error when I do the
compound [AND] condition. I've looked at it for so long I am probably
missing a ' or something.


any thoughts/direction/ideas would be greatly appreciated

Suzanne
Collin College
Frisco TX
 
D

Dirk Goldgar

sacklin said:
I get the Runtime 13 error on this line of code:
========================================
holdstring = "[Course] = ' " & holdCourse & " ' " And "[ssbsect_term_code]
=
' " & holdTerm & " ' "
========================================

It looks to me like you need to get the "And" inside your double-quotes:

holdstring = _
"[Course] = ' " & holdCourse & " ' And [ssbsect_term_code] = ' " &
holdTerm & " ' "

It also looks like you have extra spaces in your string literals, such that
this might be better:

holdstring = _
"[Course] = '" & holdCourse & "' And [ssbsect_term_code] = '" &
holdTerm & "'"

But maybe you just added the spaces for readability.
 
S

sacklin

Thank you Dirk ... that did get me past that runtime error only to toss me
another one, but I had to get past that one. :)



Suzanne



Dirk Goldgar said:
sacklin said:
I get the Runtime 13 error on this line of code:
========================================
holdstring = "[Course] = ' " & holdCourse & " ' " And "[ssbsect_term_code]
=
' " & holdTerm & " ' "
========================================

It looks to me like you need to get the "And" inside your double-quotes:

holdstring = _
"[Course] = ' " & holdCourse & " ' And [ssbsect_term_code] = ' " &
holdTerm & " ' "

It also looks like you have extra spaces in your string literals, such that
this might be better:

holdstring = _
"[Course] = '" & holdCourse & "' And [ssbsect_term_code] = '" &
holdTerm & "'"

But maybe you just added the spaces for readability.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top