I used to be a maths tutor, and I very quickly learned the difference between
answering by rote and true understanding. So far I feel like I’m still doing
the programming steps by rote, which is why I’ve got stuck. Hopefully the
understanding will grow.
So, to be precise:
My database has one module, named FirstOfNextMonth.
When I click Design from the Database window, the Visual Basic window opens
and shows the following code:
Function FirstOfNextMonth()
FirstOfNextMonth = DateSerial(Year(Now), Month(Now) + 1, 1)
End Function
In the Properties for the form, I used the Builder to enter the
ControlSource expression, and I’ve checked it again, so the spelling is
correct at that point.
Is that enough detail to guide you?
"SteveS" wrote:
> "Peter K" wrote:
>
> > I’m a novice at VB programming. At present I’m working my way through this
> > Microsoft article:
> > http://www.microsoft.com/accessdev/a...ers/ba02_3.htm
> >
> > (Chapter 2 - Introducing Visual Basic)
> > (Part 3, Creating your first function)
> >
> > I’ve set up a practice database.
> > I created the module: FirstOfNextMonth()
> > I created a simple Orders table with 4 fields including BillingDate.
> > I created an Orders form with controls for each field.
> > In design view I opened the Properties dialog box.
> > Under ControlSource I deleted BillingDate and typed
> > =FirstOfNextMonth()
> > When I switched to form view the control displayed #Name?
> >
> > As far as I can tell, I simply copied the instructions from the article.
> > I am completely lost - where have I gone wrong?
> >
> >
>
> The first thing I would do is check the spelling.
>
> When you created the new standard module, was it saved with a name like
> Module1 ? And the function in it is Public Function FirstOfNextMonth()?
> I ask because you said " I created the module: FirstOfNextMonth()".
>
> --
> Steve S
> --------------------------------
> "Veni, Vidi, Velcro"
> (I came; I saw; I stuck around.)