Solved

Passing 2 string arguments to Function

Posted on 2011-03-21
3
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

632 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