Re: Calling a sub

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You're calling Add_This, but the sub is called Add-This (hyphen vs
underscore)
Hyphens cannot be used in function & variable names.

<PaulB> wrote in message news:qlp461hljp8dv0g372s7057of464n4ahtc@xxxxxxxxxx
> Hi again,
>
> Can someone tell me what I'm doing wrong with this call, please?
>
> I keep getting an "undeclared variable error
>
> ...
> ...
> Select case Index
> Case 0
> ' add a new record
> Add_This
> ...
> ...
>
> Private Sub Add-This <--- this is where I see "error"
>
> End Sub
>
> Thanks
>
> Paul


.



Relevant Pages

  • Re: Hide or show Control Button on Form in Access 97
    ... > Private Sub Combo3_BeforeUpdate ... the Detail area of the Main Form and Command Button 7 is located in the Form ... Underscore "_" between characters that have spaces or just put a space, ... >> selection. ...
    (microsoft.public.access.forms)
  • Re: Sorting Datagrid With Hyphen / Dash
    ... Regardless of the ASCII value of the hyphen, this sort order is WRONG, all ... the '30-' codes should be together, and all the '303' codes should be ... > underscore(_) character and do comparison. ... > If you change the hyphens to underscore, then you will need to revert ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: A "sub" question...
    ... > Note the leading underscore in the sub name. ... > like making it "private"? ... But as a convention: that means: you sensible reader, ...
    (perl.beginners)
  • Re: template macro
    ... I changed the code at one point to have an underscore after .Range ... I thought that was supposed to link the lines (i.e. make the line act as one ... > Doug Robbins - Word MVP ... >> End Sub ...
    (microsoft.public.word.docmanagement)
  • Re: Autofill Based on a Changing Column
    ... your data first just in case. ... Note that a space and underscore at the end of a line is a line break in an ... Sub CopyPasteFormula() ... Dim rngActiveCell As Range ...
    (microsoft.public.excel.programming)