Solved

What's Wrong with My Access 2013 Web App Macro?

Posted on 2014-11-24
2
334 Views
Last Modified: 2014-11-24
I'm having trouble updating a text box that is formatted to accept a General Date in an Access 2013 Web App.  Here's what's supposed to happen.

1.  The user selects a term from the Term (Months) combo box.
2.  After the value in the combo box is updates (and assuming it is not empty), the macro is supposed to add the number of months selected in the combo box to the date/time value in the Effective Date field and enter the result of that calculation in the Expiration Date field.

Access is telling me that there's a problem with my DateAdd function in the macro however I see no problem with it.  Interestingly, Access stops telling me there's a problem if I remove the "=" sign from in front of the DateAdd function, however as you might expect that just causes the string "DateAdd(...)" to be placed in the Expiration Date field.

I'm attaching a couple of screenshots to help clarify this.

Any idea what I'm doing wrong here?
Thanks!
Capture-EffectiveDate.PNG
Capture-Term-AfterUpdateMacro.PNG
0
Comment
Question by:penlandt
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
penlandt earned 0 total points
ID: 40463340
Found my own answer.  Apparently the syntax for the web app version of the DateAdd function is different than the desktop version.  Rather than using the "m" argument to represent "month", the function Month should be used instead:

WRONG:
=DateAdd("m",1,[txtEffectiveDate])

RIGHT:
=DateAdd(Month,1,[txtEffecitveDate])
0
 
LVL 1

Author Closing Comment

by:penlandt
ID: 40463341
Found my own answer.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

911 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

17 Experts available now in Live!

Get 1:1 Help Now