get error Runtime error 2342--
A RunSql action requires an argument consisting of a SQL Statement
Below is the code--started on this last week--
Trying to creat Unique ID Field--General Discussion
tblyearvalue consists of two fields
UserGroup Value
UI-2001 1
AS-2001 1
Know it is something small most likely but have been looking at to much--can not see--anyone with any ideas
Created query--can do with no problem the sql for that is
SELECT [TXTYrValue] & "-" & ([Value]+1) AS Txtyearvalue, &_[TXTYrValue] & "-" & ([Value]+1) AS RequestID
FROM TblYearValue INNER JOIN TblProject ON TblYearValue.UserGroup = TblProject.TXTYrValue;
This works in the query--but not when transposed to the input form--
Code for input
Private Sub DateRequest_AfterUpdate()
Dim EDPTrack As Database
Dim rstTblYearValue As Recordset
Dim rsTblProject As Recordset
Dim MySql As String
Dim strAA As String
Dim StrDate As String
Dim strNumb As String
Dim StrOut As String
Dim strOuta As String
Dim strVal As String
strAA = UserControl.Value
StrDate = Right(DateRequest, 2)
StrDate = "20" + StrDate
'Setting up strout to go to tblYearValue to get value
StrOut = strAA + StrDate
StrOut = strAA & "-" & StrDate
MySql = "SELECT value FROM tblyearvalue WHERE &_ Usergroup='StrOut';"
DoCmd.RunSQL MySql
strNumb = MySql
strNumb = "000" + strNumb
strNumb = Right(strNumb, 3)
strOuta = Format(strAA + StrDate + strNumb, ">@@-@@@@-@@@"
RequestID.Value = strOuta
End Sub
WHEN THIS RUNS GETS THE LAST THREE CHARACTERS IN MYSQL
"T, ;"
A RunSql action requires an argument consisting of a SQL Statement
Below is the code--started on this last week--
Trying to creat Unique ID Field--General Discussion
tblyearvalue consists of two fields
UserGroup Value
UI-2001 1
AS-2001 1
Know it is something small most likely but have been looking at to much--can not see--anyone with any ideas
Created query--can do with no problem the sql for that is
SELECT [TXTYrValue] & "-" & ([Value]+1) AS Txtyearvalue, &_[TXTYrValue] & "-" & ([Value]+1) AS RequestID
FROM TblYearValue INNER JOIN TblProject ON TblYearValue.UserGroup = TblProject.TXTYrValue;
This works in the query--but not when transposed to the input form--
Code for input
Private Sub DateRequest_AfterUpdate()
Dim EDPTrack As Database
Dim rstTblYearValue As Recordset
Dim rsTblProject As Recordset
Dim MySql As String
Dim strAA As String
Dim StrDate As String
Dim strNumb As String
Dim StrOut As String
Dim strOuta As String
Dim strVal As String
strAA = UserControl.Value
StrDate = Right(DateRequest, 2)
StrDate = "20" + StrDate
'Setting up strout to go to tblYearValue to get value
StrOut = strAA + StrDate
StrOut = strAA & "-" & StrDate
MySql = "SELECT value FROM tblyearvalue WHERE &_ Usergroup='StrOut';"
DoCmd.RunSQL MySql
strNumb = MySql
strNumb = "000" + strNumb
strNumb = Right(strNumb, 3)
strOuta = Format(strAA + StrDate + strNumb, ">@@-@@@@-@@@"
RequestID.Value = strOuta
End Sub
WHEN THIS RUNS GETS THE LAST THREE CHARACTERS IN MYSQL
"T, ;"