Visual Basic para Aplicaciones - Codigo Visua Basic

Life is soft - evento anual de software empresarial
 
Vista:

Codigo Visua Basic

Publicado por JOSE GUERRA (1 intervención) el 24/11/2009 19:27:52
Cordial saludo, estoy implemetando un formulario en access, con un control image para que el usuario pueda capturar una foto en el, lo que quiero saber es como implementar en un Boton de comando el pro cedimiento respectivo para que al evento click, sobre el boton el usuario pueda llegar hasta la carpeta donde se encuentran las fotos y seleccionar la que necesite y subirla al formulario. la fotos estan en formato Bmp.

Atentamente

Jose Guerra
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Codigo Visua Basic

Publicado por Zeus Alberto Páez Rentería (26 intervenciones) el 04/02/2010 19:51:29
Bueno pues yo uso este codigo en excel para seleccionar un archivo, espero te sirva.

Saludos desde Mexicali B.C. Mexico
Ing. Zeus Alberto Paez Renteria
http://www.excaliburchessclub.piczo.com

Public Sub SelectFile()
Dim PATHFILE As String ' Contiene el path con el nombre del archivo
'Declare a variable as a FileDialog object.
Dim fd As FileDialog
'Create a FileDialog object as a File Picker dialog box.
Set fd = Application.FileDialog(msoFileDialogFilePicker)

'Declare a variable to contain the path
'of each selected item. Even though the path is a String,
'the variable must be a Variant because For Each...Next
'routines only work with Variants and Objects.
Dim vrtSelectedItem As Variant

'Use a With...End With block to reference the FileDialog object.
With fd
.AllowMultiSelect = True
'Add a filter that includes GIF and JPEG images and make it the second item in the list.
'.Filters.Add "Files", "*.xls;"

'Sets the initial file filter to number 2.
'.FilterIndex = 2

'Use the Show method to display the File Picker dialog box and return the user's action.
'If the user presses the action button...
If .Show = -1 Then

'Step through each string in the FileDialogSelectedItems collection.
For Each vrtSelectedItem In .SelectedItems

'vrtSelectedItem is a String that contains the path of each selected item.
'You can use any file I/O functions that you want to work with this path.
'This example simply displays the path in a message box.

'Aqui seleccionas el archivo yo solo necesitaba el path
PATHFILE = vrtSelectedItem
Next vrtSelectedItem
'If the user presses Cancel...
Else
End If
End With
'Set the object variable to Nothing.
Set fd = Nothing
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar