Pictures on forms

V

veli.izzet

Hi,

I used to use the following code for showing pictures on forms in
Access 2003.
Now I use Access 2007, and I get an error message.

The code that used to work is:
----

Private Sub Form_Current()
On Error Resume Next

If Len(Dir(CurrentProject.Path & "\slides\" & Left(Me![KOD], 8) &
".jpg")) > 0 Then
Me![ImagePic].Picture = CurrentProject.Path & "\slides\" &
Left(Me![KOD], 8) & ".jpg"
Else
Me![ImagePic].Picture = ""
End If
Call LockBoundControls(Me, True)
Me.txtHidden.SetFocus
End Sub
 
V

veli.izzet

Hi,

I am totally lost here, I had no problem with Access 2003, and right
after I installed Access 2007, apart from this issue, none of the
buttons on the form works.

I get the error message The expression On Current has the event
property setting bla,bla, bla..

It says something to the effect that Access cannot evaluate the
location of the logic for the event. whatever it means.

The same error pops of with the on click buttons.

I do not really know how to debug the event procedure, so I cannot run
the code and see where it stops.

Regards







I notice in your code, you refer to a function:

Call LockBoundControls(Me, True)

But I don't see that function posted. Is it possible that the error is
generated because your application cannot find the function LockBoundControls
? If not, when you set a stop, where does the code error out?

--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access


Hi,

I used to use the following code for showing pictures on forms in
Access 2003.
Now I use Access 2007, and I get an error message.

The code that used to work is:
----

Private Sub Form_Current()
On Error Resume Next

If Len(Dir(CurrentProject.Path & "\slides\" & Left(Me![KOD], 8) &
".jpg")) > 0 Then
Me![ImagePic].Picture = CurrentProject.Path & "\slides\" &
Left(Me![KOD], 8) & ".jpg"
Else
Me![ImagePic].Picture = ""
End If
Call LockBoundControls(Me, True)
Me.txtHidden.SetFocus
End Sub
 

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

Similar Threads


Top