B
Brian Bastl
Hi all,
A2K, Dao 3.6
was looking at a problem a previous poster encountered, and I can't get it
to work either.
I've created a table with 3 fields to roughly mimmick his.
Table name = tblCurrencies
ID <PK - auto>
Currency 'text GBP, USD, EUR
Symbol 'text £, $, ?
I've set up an unbound form with 1 text control and 1 cmdbutton.
Err.Number is 3134
syntax error in "insert into...."
Where's the syntax error?
-------------------------------------------
Private Sub Command2_Click()
Dim db As Database
Dim st As String
Set db = CurrentDb
st = "INSERT INTO tblCurrencies (Currency) "
st = st & "VALUES ('" & Me.txtCurrency & "')"
db.Execute st, dbFailOnError
End Sub
----------------------------------------------
Typing ?st in the Immediate window produces:
INSERT INTO tblCurrencies (Currency) VALUES ('GBP')
This is making me nuts. I know I'm missing something.
Brian
A2K, Dao 3.6
was looking at a problem a previous poster encountered, and I can't get it
to work either.
I've created a table with 3 fields to roughly mimmick his.
Table name = tblCurrencies
ID <PK - auto>
Currency 'text GBP, USD, EUR
Symbol 'text £, $, ?
I've set up an unbound form with 1 text control and 1 cmdbutton.
Err.Number is 3134
syntax error in "insert into...."
Where's the syntax error?
-------------------------------------------
Private Sub Command2_Click()
Dim db As Database
Dim st As String
Set db = CurrentDb
st = "INSERT INTO tblCurrencies (Currency) "
st = st & "VALUES ('" & Me.txtCurrency & "')"
db.Execute st, dbFailOnError
End Sub
----------------------------------------------
Typing ?st in the Immediate window produces:
INSERT INTO tblCurrencies (Currency) VALUES ('GBP')
This is making me nuts. I know I'm missing something.
Brian