Pictures

Gruung

Registered User.
Local time
Today, 21:28
Joined
Nov 25, 2003
Messages
35
On my open form I have this code, the from is based on a query which asks you what class you want 12 or 13. If it is 12 i want the default value for class to be 12 and i want the image to be Year12.gif. The default value bit works, i have tried it without the image bit of the code, however how do I get the image bit working?

Private Sub Form_Open(Cancel As Integer)

If Forms!StudentsEditMode!Class = 12 Then
Me.Class.DefaultValue = 12 And Me.Image38 = /pictures/Year12.gif
Else: Me.Class.DefaultValue = 13 And Me.Image38 = /pictures/Year13.gif
End If

End Sub
 
In Windows, the file paths use these slashes: "\", not these "/". Also, you need to include quotes around the filenames. I also don't know what Access uses as the default directory, but you're best off specifying the complete path.
 
I still cant get it to work. Do i want an image or an Bound object frame
 
I personally use an image object. I change the picture being displayed using code like this:
Me.imgImageObject1.Picture = "D:\pictures\13.gif"
 
I mean an image control - you know, the one from the Access Toolbox. It's covered in the Access online help under "Add an unbound picture using an image control".
 
sorry i was being stupid...right it works now thanks
 

Users who are viewing this thread

Back
Top Bottom