Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Lier photos à travers le réseau

1 réponse
Avatar
Marie-Claire
Bonjour,
J'ai trouvé une application que l'on voudrait bien utiliser sur des postes
de travail, la voici:

Private Sub cmdPhoto_Click()
Dim strLink As String

On Error GoTo Catch01

strLink = OuvrirUnFichier(Me.Hwnd, "Sélectionner une photo pour le salarié "
& Me.Nom, 1)

If Len(strLink) > 0 Then
Me.imgPhoto.Picture = strLink
Me.Photo = strLink
End If

DisplayPhoto
Exit Sub

Catch01:
Select Case Err.Number
Case 2114
MsgBox "Le format de l'image n'est supporté par le contrôle image
Picture", vbCritical + vbOKOnly, "Application Photos"
Exit Sub
Case 2220
MsgBox "Le fichier image n'a pas été trouvé à l'emplacement indiqué
: " & vbCrLf & Me.Photo, vbCritical + vbOKOnly, "Application Photos"
Exit Sub
Case Else
MsgBox "Erreur inattendue : " & Err.Number & vbCrLf &
Err.Description, vbCritical + vbOKOnly, "Application Photos"
End Select
Err.Clear


End Sub

Private Sub Form_Current()
If Len(Me.Nom) > 0 Then
Me.Caption = "Détails pour le salarié : " & Me.Nom & " - " & Me.Prénom
Else
Me.Caption = "Saisie d'un nouveau salarié"
End If

On Error GoTo Catch02

If Len(Me.Photo) > 0 Then
Me.imgPhoto.Picture = Me.Photo
Else
Me.imgPhoto.Picture = CurrentProject.Path & "\images_tutophotos\blank.jpg"
End If

DisplayPhoto

Exit Sub

Catch02:
Select Case Err.Number
Case 2114
MsgBox "Le format de l'image n'est supporté par le contrôle image
Picture", vbCritical + vbOKOnly, "Application Photos"
Me.imgPhoto.Picture = CurrentProject.Path &
"\images_tutophotos\blank.jpg"
Me.Photo = vbNullString
Case 2220
MsgBox "Le fichier image n'a pas été trouvé à l'emplacement indiqué
: " & vbCrLf & Me.Photo, vbCritical + vbOKOnly, "Application Photos"
Me.imgPhoto.Picture = CurrentProject.Path &
"\images_tutophotos\blank.jpg"
Me.Photo = vbNullString
Case Else
MsgBox "Erreur inattendue : " & Err.Number & vbCrLf &
Err.Description, vbCritical + vbOKOnly, "Application Photos"
End Select
Err.Clear

End Sub
Comment dois-je la modifier pour que l'on puisse aller chercher les photos
qui se trouvent dans un dossier à travers le réseau?
Merci beaucoup pour votre aide et 'très bonnes fêtes à tous'.
Marie-Claire
--
Marie-Claire

1 réponse

Avatar
3stone
Salut,

"Marie-Claire"
| J'ai trouvé une application que l'on voudrait bien utiliser sur des postes
| de travail, la voici:
<snip>


cela doit venir de cette fonction :

strLink = OuvrirUnFichier(Me.Hwnd, "Sélectionner une photo pour le salarié " & Me.Nom, 1)



Mais, la méthode n'est pas heureuse... pour le moins !
Si la base est utilisée en réseau, il faut copier les photos dans un repertoire
sur le "serveur" pour quelles soient disponible pour chacun et sans risque.

Ensuite, utiliser la méthode suivante pour les afficher :
http://www.self-access.com/access/grenier/acRedir.php?id


--
A+
Pierre (3stone) Access MVP
Perso: http://www.3stone.be/
Conseils MPFA: http://www.mpfa.info/