Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Passing 2 string arguments to Function

Posted on 2011-03-21
3
Medium Priority
?
242 Views
Last Modified: 2012-05-11

See function Audit(..) below.
I have just amended this function to accept a second argument (Auditcat).
 
I then changed my  VBA that calls the function to the following;
Audit("a","b")


I get an immediate compile error "Expected :="  WHY?
I have never passed 2 arguments before - it seems to be the second argument that is causing the problem?? Is the syntax in Audit("a","b") wrong ?

If this is not clear I can create a database with an example and attach it.
....
Function Audit(ByRef PrimaryKey, ByRef Auditcat)
On Error GoTo Audit_err

Open in new window

0
Comment
Question by:Patrick O'Dea
3 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 1200 total points
ID: 35180234
try

Audit "a","b"
0
 
LVL 20

Assisted Solution

by:darbid73
darbid73 earned 800 total points
ID: 35180352
If you want to use your format the put a call in front of it

Call Audit("a","b")

This will work provided that the function Audit is available from where you call it.
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 35180504
Thanks all,  a nice simple solution!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question