|
-
Sep 12th, 2000, 10:19 AM
#1
Thread Starter
Junior Member
I am trying to create a query using a variable (strFilterLIne) to set the filter. The program with create the query, however, in the SELECT statement it doesn't understand that strFilterLine is a variable equal to "FPT", it interprets it as a character string. Any ideas how I can get it to read strFilterLine as a variable?
Thanks,
Ern
Private Sub Command16_Click()
Dim dbs As Database, qdf As QueryDef, strSQL As String
Dim strFilterLine As String
Set dbs = CurrentDb
strFilterLine = "FPT"
DoCmd.DeleteObject acQuery, "Append to Used Temp(1)"
strSQL = "Select Week,Year,LineYear from Used where [linecode] = strFilterLine"
Set qdf = dbs.CreateQueryDef("Append to Used Temp(1)", strSQL)
Set dbs = Nothing
End Sub
-
Sep 12th, 2000, 10:44 AM
#2
Lively Member
Is this that you are looking for ?
strSQL = "Select Week,Year,LineYear from Used where [linecode] = '" & strFilterLine & "'"
Yesterday, all my troubles seemed so far away...
Help, I need somebody, Help...
Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.
-
Sep 12th, 2000, 11:11 AM
#3
Thread Starter
Junior Member
AKA,
Thanks. That works great.
ern
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|