View Single Post
Old 08-03-2011, 06:28 AM   #8
JANR
Newly Registered User
 
Join Date: Jan 2009
Location: Norway
Posts: 1,623
Thanks: 7
Thanked 167 Times in 160 Posts
JANR has a spectacular aura about JANR has a spectacular aura about
Re: compile error: expected: expression

A function or a sub is requiered to execute any VBA code, yes

ex:
Code:
Private Sub MyButton_Click()
Dim s As String
s = " Insert Into MyTable (FName) Select 'Fred' Where Id=1"
Currentdb.Execute s, dbFailOnError
End Sub
JR
JANR is offline   Reply With Quote