I can't for the life of me figure this out. The syntax looks good to me. Any help would be appreciated.
thanks
CurrentDb.Execute "Insert Into RulesNotCrD(AccountName, Note) Values ('" & Me.cboAcName & "','" & Me.Text18 & "')"
Printable View
I can't for the life of me figure this out. The syntax looks good to me. Any help would be appreciated.
thanks
CurrentDb.Execute "Insert Into RulesNotCrD(AccountName, Note) Values ('" & Me.cboAcName & "','" & Me.Text18 & "')"
Have you checked what that actual string looks like? Never assume that the data you are using is what you think it is when it doesn't work. Always check.Code:MsgBox "Insert Into RulesNotCrD(AccountName, Note) Values ('" & Me.cboAcName & "','" & Me.Text18 & "')"
It is the use of the column name 'Note'. It's a reserved word. So it either needs to be placed in brackets or another name needs to be used.
thanks!
Here's a link to a list of reserved words:
http://support.microsoft.com/default...b;en-us;286335
That must depend on the database because in SQL Server 2005 this works just fine:
create table RulesNotCrD(AccountName char(10), Note char(20))
Insert Into RulesNotCrD(AccountName, Note) Values ('TestIt', 'TestNote')
select * from RulesNotCrD
drop table RulesNotCrD
It does depend on the database system, and various other things too (such as the driver/provider you are using to connect), which is why multiple lists are given for various items in the article What names should I NOT use for tables/fields/views/stored procedures/...? from our Database Development FAQs/Tutorials (at the top of this forum)
I have the same Issue I cant figure this out, whats wrong with this??
CurrentDb.Execute "INSERT INTO BillTabe(ID, Venor, TxnDate, RefNumber, LineItem, LineDesc, LineQty, LineBillableEntity, LineUnitPrice, LineAmount, LineBillableStatus)" & _
" VALUE(" & Me.txtID & "','" & Me.cboVendor & "','" & Me.txtTxnDate & "','" & Me.txtRefNumber & "','" & Me.txtLineItem & "','" & Me.txtLineDesc & "','" & Me.txtLineQty & "','" & _
Me.cboLineBillableEntity & "','" & Me.txtLineUnitPrice & "','" & Me.txtLineAmount & "','" & Me.txtLineBillableStatus & "')"