Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run a parameterized action (append) query with MEMO parameter via VBA? 1

Status
Not open for further replies.

sudakov

Programmer
Jun 17, 2007
53
0
0
US
Hello,
I have a table with a MEMO field.
I want to add records into the table by executing a parameterized action (append) query via VBA.
Does anybody know how to run a parameterized action (append) query with MEMO parameter via VBA?

Thank you.
sudakov.
 
Hi Duane,
Thank you.
Your recommendation works!

The reason for using a query is that I can re-use the code every time I need to execute an action query that has a Memo parameter.

The following is the SQL view of the query:
Code:
PARAMETERS [prmMem] LongText;
INSERT INTO tblLog ( Message )
SELECT [prmMem] AS Expr1;

Sudakov.
 
I'm not sure if Access supports an append query without using a FROM clause.

I would use something like:

Code:
Dim strSQL as String
strSQL = "INSERT INTO tblLog( Message) " & _
  "Values( """ & Me.txtMyLogMessage & """ )"
Currentdb.Execute strSQL, dbFailOnError

Duane
Hook'D on Access
MS Access MVP
 
Hi Duane,
Thank you.
It works!

Sudakov.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top