Solved

Passing 2 string arguments to Function

Posted on 2011-03-21
3
222 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 300 total points
ID: 35180234
try

Audit "a","b"
0
 
LVL 20

Assisted Solution

by:darbid73
darbid73 earned 200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

685 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