Hi
I have the the code below for opening a form with link criteria.
need to open the form as read only..how?
Mattias
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "TransaktionshuvudDepo"
stLinkCriteria = "[Transaktionsnr]=" & Me![Transaktionsnr]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Resume Exit_Form_Open
End Sub
Marshall Barton - 21 Apr 2005 23:25 GMT
>I have the the code below for opening a form with link criteria.
>need to open the form as read only..how?
[quoted text clipped - 16 lines]
>
>End Sub
A quick look in Help indicates that you want to use:
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly

Signature
Marsh
MVP [MS Access]
fredg - 21 Apr 2005 23:28 GMT
> Hi
>
[quoted text clipped - 20 lines]
>
> End Sub
Doesn't your VBA help work?
Even if you simply wrote the OpenForm code, Intellisense would have
given you the various options as you typed.
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly

Signature
Fred
Please only reply to this newsgroup.
I do not reply to personal email.