Solved

access function - choking on syntax

Posted on 2013-12-28
2
485 Views
Last Modified: 2013-12-28
Dear experts -
I have a function, but it's choking on the very first line of the declaration:

Public Function salesvalue(sortstatus As String, optional Milestone_ID As Integer, periodtype As String, whichperiod As Integer, includeprior As Boolean, TotalEstValue As Double, optional QuoteAmnt As Double, StartDate As Date, optional ExpDate As Date, optional EstDuration As Integer, weighted As Boolean, optional Probability As Double) As Double

The error message I get is: "syntax error"; it also shows "expected: Optional" if I try to edit it.

Any ideas?

Thanks -
0
Comment
Question by:terpsichore
2 Comments
 
LVL 13

Accepted Solution

by:
Carl Bohman earned 500 total points
ID: 39743954
As I recall, All optional parameters need to follow the required parameters.  Your second option (Milestone_ID) is marked as optional.  That means that everything that follows it needs to be optional as well.  However, several of the following options are not optional.

To fix, move all of your optional parameters to the end of the declaration.  This may require some changes on the lines where you are calling this function.  Just be sure to make the same changes in order.
0
 

Author Closing Comment

by:terpsichore
ID: 39743958
perfect - many thanks
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

14 Experts available now in Live!

Get 1:1 Help Now