Help needed with code

V

Veli Izzet

Hi all,

On a form I have a picture field and I use the following code for
getting the picture on the form:

Private Sub Form_Current()
On Error Resume Next
If Len(Dir(CurrentProject.Path & "\slides\" & Me![KOD] & ".jpg")) Then
Me![ImagePic].Picture = CurrentProject.Path & "\slides\" & Me![KOD]
& ".jpg"
Else
Me![ImagePic].Picture = ""
End If
End Sub

Now I want to modify this to use the Leftmost 8 characters of Me![KOD]
(or leave the rightmost 2 characters that show the variants out).

How do I do it?

Thanks for answers...
 
V

Veli Izzet

Thanks Norman..

Norman said:
In VBA Object Browser/Help, look for function Left()/Mid()/Right()...

Hi all,

On a form I have a picture field and I use the following code for getting
the picture on the form:

Private Sub Form_Current()
On Error Resume Next
If Len(Dir(CurrentProject.Path & "\slides\" & Me![KOD] & ".jpg")) Then
Me![ImagePic].Picture = CurrentProject.Path & "\slides\" & Me![KOD] &
".jpg"
Else
Me![ImagePic].Picture = ""
End If
End Sub

Now I want to modify this to use the Leftmost 8 characters of Me![KOD] (or
leave the rightmost 2 characters that show the variants out).

How do I do it?

Thanks for answers...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top