Solved

Passing 2 string arguments to Function

Posted on 2011-03-21
3
190 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
Comment Utility
try

Audit "a","b"
0
 
LVL 19

Assisted Solution

by:darbid73
darbid73 earned 200 total points
Comment Utility
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
Comment Utility
Thanks all,  a nice simple solution!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now