access

General software, Operating Systems, and Programming discussion.
Everything from software questions, OSes, simple HTML to scripting languages, Perl, PHP, Python, MySQL, VB, C++ etc.
Post Reply
User avatar
lance-tek
SG Elite
Posts: 5601
Joined: Thu Apr 05, 2001 12:00 am
Location: Indianapolis, IN

access

Post by lance-tek »

what is the syntax for doing a substring in access? I am tring to make a report but I just need to use the first value in my field

i am doing this in a query but I can not seem to get it right.

thanks
A mistake does not become an error until one refuses to correct it

Folding for the future ;)
User avatar
parse27
Regular Member
Posts: 157
Joined: Thu Jun 20, 2002 1:34 pm
Location: 10,000 dreams and climbing

Post by parse27 »

how about create a query for the field which first value you want
to show.

then create a form and in the "On Enter" event of text box that
displays the field choose "[Event Procedure]". you will then be
shown the IDE of VB embedded in Access.

In the "Enter" event of the text box place this code snippet:
field1.Text = Mid(field1.Text, 1, 1)

Here's the example. If you want the mdb file i used to come up
with this email me at eanna_mage@yahoo.com
and i will send it to you as an attatchment.

Private Sub field1_Enter()
field1.Text = Mid(field1.Text, 1, 1)
End Sub

Hope this helps,
parse27 :D
skipping sunbeams :)
User avatar
lance-tek
SG Elite
Posts: 5601
Joined: Thu Apr 05, 2001 12:00 am
Location: Indianapolis, IN

Post by lance-tek »

actually I was going for a Left([field],1,1) = X

but thank you for the reply...... now I know who to holler at if I get into a mess again :p
A mistake does not become an error until one refuses to correct it

Folding for the future ;)
Post Reply