Hi,
Is there conflict between making a form read-only and having a hyperlink field on that form?
This is what I am hoping to do:
When a selection is made from the combo box of a form, another form opens for confirmation purposes. (E.g. If Item 1 is selected, a form about item details opens, showing specifically the record of Item 1 so that users can check.) The information in the second form cannot be changed.
I'm using this code to open the form as "read only":
DoCmd.OpenForm FormName, acNormal, , "[PartNumber]='" & Me!PartNumber & "'", acFormReadOnly
And so it opens as "read-only". But there is a button (called "Select file") on the form, that opens a dialog box that allows users to select a file for the hyperlink. Though indeed the form is at first read-only, this button allows users to change/add the hyperlink and after this happens the form is no longer read-only.
This button was created by following the instructions found on this site: http://www.utteraccess.com/forums/printthread.php?Cat=&Board=89&main=1611468&type=thread
The code used for the button is like this:
A module (modFileDialog) is involved and it's from: http://www.mvps.org/access/api/api0001.htm
Why does changing/adding the attachment seem to make the form lose its "read only-ness"? Is there a way (apart from Enable -> No) to prevent users from clicking the "Select file" button?
Thanks in advance!
Regards.
Is there conflict between making a form read-only and having a hyperlink field on that form?
This is what I am hoping to do:
When a selection is made from the combo box of a form, another form opens for confirmation purposes. (E.g. If Item 1 is selected, a form about item details opens, showing specifically the record of Item 1 so that users can check.) The information in the second form cannot be changed.
I'm using this code to open the form as "read only":
DoCmd.OpenForm FormName, acNormal, , "[PartNumber]='" & Me!PartNumber & "'", acFormReadOnly
And so it opens as "read-only". But there is a button (called "Select file") on the form, that opens a dialog box that allows users to select a file for the hyperlink. Though indeed the form is at first read-only, this button allows users to change/add the hyperlink and after this happens the form is no longer read-only.
This button was created by following the instructions found on this site: http://www.utteraccess.com/forums/printthread.php?Cat=&Board=89&main=1611468&type=thread
The code used for the button is like this:
Code:
Dim strFilter As String
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "PDF Files (*.PDF)", "*.PDF")
strFilter = ahtAddFilterItem(strFilter, "Word Files (*.DOC)", "*.DOC*")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select the file to attach", _
Flags:=ahtOFN_HIDEREADONLY)
If Len(strInputFileName) > 0 Then
Me.AttachSpecSheet = "#" & strInputFileName & "#"
End If
A module (modFileDialog) is involved and it's from: http://www.mvps.org/access/api/api0001.htm
Why does changing/adding the attachment seem to make the form lose its "read only-ness"? Is there a way (apart from Enable -> No) to prevent users from clicking the "Select file" button?

Thanks in advance!

Regards.