Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing 2 string arguments to Function

Posted on 2011-03-21
3
Medium Priority
?
238 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 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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 …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

715 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