is this possible? what i would like is a command button if it's click it'll give me the option to include a file from a location on my pc. would it be possible to save it to the database? or any suggestions on this?
Don't quite understand what you want to accomplish. Are you trying to save a photo in the database? If so, which table do you want to save it to. What other fields are going to be in the table. Or, do you want to only save the address of the file within the database. There are so many different types of files available on a pc, trying to include any of these files into a database is not really a good way to gain access to these files.
Please try to expand the explanation of what you want.
just like a check mark box. that when i click it, it will then give me the option to add a file to the database just as an image file. I appologize if i'm not explaining this clearly. lets just go with a jpeg file. is there anyway to add a jpeg file to the database in a table or report or anywhere?
Here is the code that I have done as a test some time back:
Private Sub Command4_Click()
Dim conUserCancelled As Integer
' Error message returned when user cancels.
conUserCancelled = 2001
On Error GoTo ButtonErr
If BoundOLE.OLEType = acOLENone Then
' No OLE object created.
' Display Insert Object dialog box.
BoundOLE.Action = acOLEInsertObjDlg
If Err = conUserCancelled Then ' Display message.
MsgBox "You clicked the Cancel button; " _
& "no object was created."
The table field that this OLE object is being put into is a "OLE Object" data type. It can be a Word document, a jpeg, a wave file, etc.