A family of Microsoft relational database management systems designed for ease of use.
Never mind I figured it out! Thanks!
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
So I'm trying to modify some 2010 Access code for selecting an image from a file and I get this error. I have several forms which use it and some work fine but others keep giving me this error. Here is the code:
Sub getPictureTHREE()
' Displays the Office File Open dialog to choose a file name
' for the current structure record. If the user selects a file
' display it in the picture THREE image control.
Dim fileName As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Picture THREE"
.Filters.Add "All Files", "*.*"
.AllowMultiSelect = False
result = .Show
If (result <> 0) Then
fileName = Trim(.SelectedItems.Item(1))
Me![THIRDPATH].Visible = True This is the line that is giving me the error
Me![THIRDPATH].SetFocus
Me![THIRDPATH].Text = fileName Other forms Im using this code have shown this error
Me![PICTURE_THREE_NOTES].SetFocus
Me![THIRDPATH].Visible = False
End If
End With
End Sub
Im a beginner at Access so not 100% sure what I'm doing. Thanks!
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Never mind I figured it out! Thanks!
Ok so after checking the name of the textbox it was not the same name as the code. However, once I fixed this I then got a Error 2135 Property is read only and can't be set. This is in reference to the second line I mentioned in my first post the line Me![ONEPATH].Text=fileNameso now I am confused on why I am getting this error.
THIRDPATH is the name of a field in a table and it is going to store the image path in the table after it is selected. I have another form using similar code and had a problem with the Me![PATH].VISIBLE=TRUE line and before I just rename the field in the table from PROFILE1PATH to LEFTPICTUREPATH and this solved the problem. Not 100% sure why but again I am a beginner at Access so who am I to question it when it works :)
What kind of control is THIRDPATH? Are you sure that is its name. A better way to write it would be:Me.THIRDPATH.Visible
By using a dot instead of an exclamation point, you will get the help of the IntelliSense. As soon as you type the dot a list of properties, methods, controls will pop up in a context menu. That will give you a way to select THIRDPATH without having to type it in blindly thus avoiding misspelling.
Is "THIRDPATH" the name of a control on the form? Please double-check to make sure its name wasn't misspelled. If it is a control, what type of control is it?