Kamis, 22 September 2011

[MS_AccessPros] Re: Adding OrderBy to sql in code AND necessity of "IsNothing" line

 

Thanks! That did the trick! Con

--- In MS_Access_Professionals@yahoogroups.com, "Graham Mandeno" <graham@...> wrote:
>
> Hi Connie
>
> Sorry – I left a spurious ) in the SQL statement:
>
> "SELECT LastName, FirstName, SpouseFN " _
> & " FROM Contacts " _
> & " WHERE Soundex([LastName]) = '" & Soundex(Me.LastName) & "'" _
> & " ORDER BY LastName, FirstName;"
>
> Graham :)
>
> > From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Graham Mandeno
> > Sent: Thursday, 22 September 2011 10:32
> > To: MS_Access_Professionals@yahoogroups.com
> > Subject: RE: [MS_AccessPros] Adding OrderBy to sql in code AND necessity
> of "IsNothing" line
> >
> >  
> > Hi Connie
> >
> > For #1, your "If ... Then" statement must have a matching "End If". This
> > should be after all the code that you want to execute if Me.LastName is
> not
> > empty. The fact that it works with "If ... Then" commented out suggests
> > that the "End If" is not there.
> >
> > For #2, you add the "ORDER BY" clause (note the space) after the WHERE
> > clause:
> >
> > "SELECT LastName, FirstName, SpouseFN FROM " & _
> > "Contacts WHERE Soundex([LastName]) = '" & _
> > Soundex(Me.LastName) & "'") & _
> > & " ORDER BY LastName, FirstName;"
> >
> > Best wishes,
> > Graham
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar