T
TeeSee
First let me wish "the group" a very Happy New Year. Lang may yer lum
reek!
The following SQL code was created using "SQL Formatter". Although a
different sequence than usually shown I don't see why it won't work.
I deliberately show two "WHERE" lines as I am also trying to get the
user to input the WHERE criteria as in a normal query. The "fs*j" came
out of the original query.
I also can't resolve the error 3141 thing. Using XP and MA2003. Any
assitance would be appreciated.
Private Sub cmdUpdateDiscount_Click()
'**************************************************************
Dim stDocName As String
Dim db As DAO.Database
Dim rs1 As DAO.Recordset
Dim rsMMhist As DAO.Recordset
Dim strSQL As String
Dim strItem As String
Dim Message, Title
'**************************************************************
'Message = "Please input the filter string"
'Title = "Filter String Input"
'strItem = InputBox(Message, Title, Default, 5000, 3000)
'Set rs1 = db.OpenRecordset
strSQL = "SELECT tblMaterialMaster.Discount,"
strSQL = strSQL & "tblMaterialMaster.ListPrice,"
strSQL = strSQL & " FROM tblMaterialMaster"
strSQL = strSQL & " WHERE (((tblMaterialMaster.SISItemCode)= Like
""fs*j""))"
strSQL = strSQL & " WHERE (((tblMaterialMaster.SISItemCode)=
[Input Code]))" 'Like ""fs*j""))"
strSQL = strSQL & " ORDER BY tblMaterialMaster.Funds,"
strSQL = strSQL & "tblMaterialMaster.SISItemCode;"
strSQL = strSQL & " "
Set rs1 = CurrentDb.OpenRecordset(strSQL)
'<---------Problem code line
'(RUNTIME ERROR 3141)
' (The select statement includes a reserved word or an argument
'name that is misspelled or missing, or the punctuation is
incorrect.)
stDocName = "frmMaterialMaster"
DoCmd.OpenForm stDocName, acNormal, , , acFormEdit, ,
OpenArgs:="strSQL"
End Sub
reek!
The following SQL code was created using "SQL Formatter". Although a
different sequence than usually shown I don't see why it won't work.
I deliberately show two "WHERE" lines as I am also trying to get the
user to input the WHERE criteria as in a normal query. The "fs*j" came
out of the original query.
I also can't resolve the error 3141 thing. Using XP and MA2003. Any
assitance would be appreciated.
Private Sub cmdUpdateDiscount_Click()
'**************************************************************
Dim stDocName As String
Dim db As DAO.Database
Dim rs1 As DAO.Recordset
Dim rsMMhist As DAO.Recordset
Dim strSQL As String
Dim strItem As String
Dim Message, Title
'**************************************************************
'Message = "Please input the filter string"
'Title = "Filter String Input"
'strItem = InputBox(Message, Title, Default, 5000, 3000)
'Set rs1 = db.OpenRecordset
strSQL = "SELECT tblMaterialMaster.Discount,"
strSQL = strSQL & "tblMaterialMaster.ListPrice,"
strSQL = strSQL & " FROM tblMaterialMaster"
strSQL = strSQL & " WHERE (((tblMaterialMaster.SISItemCode)= Like
""fs*j""))"
strSQL = strSQL & " WHERE (((tblMaterialMaster.SISItemCode)=
[Input Code]))" 'Like ""fs*j""))"
strSQL = strSQL & " ORDER BY tblMaterialMaster.Funds,"
strSQL = strSQL & "tblMaterialMaster.SISItemCode;"
strSQL = strSQL & " "
Set rs1 = CurrentDb.OpenRecordset(strSQL)
'<---------Problem code line
'(RUNTIME ERROR 3141)
' (The select statement includes a reserved word or an argument
'name that is misspelled or missing, or the punctuation is
incorrect.)
stDocName = "frmMaterialMaster"
DoCmd.OpenForm stDocName, acNormal, , , acFormEdit, ,
OpenArgs:="strSQL"
End Sub