R
Ray
I have a control button on an Access form that calls a macro in a Module:
---
Private Sub Command33_Click()
CreateDocs
End Sub
---
Sub CreateDocs()
Dim objConn As New Connection
Dim objRS As New Recordset
objConn.ConnectionString = c_DBCon
objConn.Open
objRS.Open c_SQL, objConn
'Remainder of subroutine
---
c_DBCon and c_SQL are constant strings that contain datasource info and a
query respectively. c_SQL Looks like:
Const c_SQL = "SELECT * FROM
WHERE hesainst = [Text52] "
with [Text52] referring to the content of a text box on the form. When
clicking the control, I get teh error "Invalid column name 'Text52'." I
didn't think I was asking for a colmn name, but a particular record. Any
idaes what it wrong?
The code works fine if i replace [Text52] with the string I'm trying to look
up, but the string will change frequently.
Thanks for any help you can offer.
Ray
---
Private Sub Command33_Click()
CreateDocs
End Sub
---
Sub CreateDocs()
Dim objConn As New Connection
Dim objRS As New Recordset
objConn.ConnectionString = c_DBCon
objConn.Open
objRS.Open c_SQL, objConn
'Remainder of subroutine
---
c_DBCon and c_SQL are constant strings that contain datasource info and a
query respectively. c_SQL Looks like:
Const c_SQL = "SELECT * FROM
with [Text52] referring to the content of a text box on the form. When
clicking the control, I get teh error "Invalid column name 'Text52'." I
didn't think I was asking for a colmn name, but a particular record. Any
idaes what it wrong?
The code works fine if i replace [Text52] with the string I'm trying to look
up, but the string will change frequently.
Thanks for any help you can offer.
Ray