Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / February 2006

Tip: Looking for answers? Try searching our database.

Need some help with Left (string,number) command

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Darhl Thomason - 02 Feb 2006 20:39 GMT
I'm familiar with the Left (and Right and Mid) commands, but my brain
evidently isn't firing on all cylinders today.  My code is inside an
On_Click event for a command button and the value is returning the same as
the main string.  txtNumber is bound to Number which is always a 5 character
field (set as primary key), but when I use this code, strTemp results in the
same text as Me.txtNumber.

 strTemp = Left(Me.txtNumber, 2)

I have it working properly on a report where the control source of a text
box is

Left([Number],2)

Thanks!

Darhl
fredg - 02 Feb 2006 22:18 GMT
> I'm familiar with the Left (and Right and Mid) commands, but my brain
> evidently isn't firing on all cylinders today.  My code is inside an
[quoted text clipped - 13 lines]
>
> Darhl

Perhaps it's because txtNumber is getting it's data from your field
named [Number]. Whether that is the problem or not, it would be wise
to change that field name to something else.

Number is a reserved Access/VBA/Jet word and should not be used as a
field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:

109312  'Reserved Words in Microsoft Access'  for Access 97
209187  'ACC2000: Reserved Words in Microsoft Access'
286335  'ACC2002: Reserved Words in Microsoft Access'
321266  'ACC2002: Microsoft Jet 4.0 Reserved Words'
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Darhl Thomason - 02 Feb 2006 22:48 GMT
Thanks for the suggestion Fred.  I will check those articles you pointed
out.  I didn't realize that "Number" was a reserved name.  I will fix that.

On another note, the code does work, I have it in two places and only
updated one.  Of course I was only looking at the one that wasn't updating
:-) (aka big sheepish grin).

Darhl

>> I'm familiar with the Left (and Right and Mid) commands, but my brain
>> evidently isn't firing on all cylinders today.  My code is inside an
[quoted text clipped - 30 lines]
> 286335  'ACC2002: Reserved Words in Microsoft Access'
> 321266  'ACC2002: Microsoft Jet 4.0 Reserved Words'
fredg - 02 Feb 2006 22:55 GMT
> Thanks for the suggestion Fred.  I will check those articles you pointed
> out.  I didn't realize that "Number" was a reserved name.  I will fix that.
[quoted text clipped - 4 lines]
>
> Darhl

Ah I know that feeling!

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.