ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010
-
25 juil. 2008 à 09:21
ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010
-
25 juil. 2008 à 12:44
Slt, j'ai un champA de la tableA.
Je veux que quand je vais chercher une image, qu'il écrive le chemin de l'image dans le champA.
Jusque là j'écris en dure (manuellemen) le chemin dans le champA.
Pouvez-vous m'aider?
ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010 25 juil. 2008 à 12:42
J'ai fait le code qui suit et ça marche:
Private Sub Command2_Click()
Me.Parcourir1.Filter = "Fichiers image (*.jpg;*.bmp;*.gif;*.pcx)|*.jpg;*.bmp;*.gif;*.pcx"
Me.Parcourir1.ShowOpen
If Me.Parcourir1.FileName <> "" Then
On Error Resume Next
Me.CheminI = Me.Parcourir1.FileName
Me.Image2.Picture = LoadPicture(CheminI.text)
End If
Err.Clear
End Sub
ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010 25 juil. 2008 à 10:27
J'ai fait comme suit mais l'image choisie n'est pas mémorisée. Il prends tout le temps le chemin que j'ai mis en dure dans le chmpA
Dim chimage as string
...
Private Sub Command2_Click()
Me.parcourir1.InitDir = "\\MonDossier\DATA\Biblioth\Commun\LOGOS"
Me.parcourir1.Filter = "Fichiers image (*.jpg;*.bmp;*.gif;*.pcx)|*.jpg;*.bmp;*.gif;*.pcx"
Me.parcourir1.ShowOpen
If Me.parcourir1.FileName <> "" Then
On Error Resume Next
Me.Image2.Picture = LoadPicture(parcourir1.FileName)
End If
Err.Clear
End Sub
If RssR![Image] = True And Not IsNull(RssR![champA]) And Not RssR![champA] = "" Then chimage = RssR![champA]
If Dir(chimage, vbNormal) = "" Then
chimage = ""
End If
ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010 25 juil. 2008 à 12:13
J'ai fait comme suit mais ça ne marche pas.
Private Sub Command2_Click()
Dim Rs As Recordset
Dim Db As Database
Me.filedialog.InitDir = "\\MonDossier\DATA\Biblioth\Commun\LOGOS"
Me.filedialog.Filter = "Fichiers image (*.jpg;*.bmp;*.gif;*.pcx)|*.jpg;*.bmp;*.gif;*.pcx"
Me.filedialog.ShowOpen
If Me.filedialog.FileName <> "" Then
On Error Resume Next
Me.Image2.Picture = LoadPicture(filedialog.FileName) Set Rs Db.OpenRecordset("select * from sousreseau where [code reseau] " & glob_sres)
Rs![champsimage] = filedialog.FileName
End If
Err.Clear
End Sub
ddove53
Messages postés623Date d'inscriptionmardi 20 mars 2007StatutMembreDernière intervention15 juin 2010 25 juil. 2008 à 12:44
Pour plus d'infos pour ceux qui vont s'en servir:
CheminI est un textbox que j'ai mis qui a un datasource lié à la table ou se trouve le chemin de mon image et Parcourir1 est mon Filedialog.