Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a form read-only

Status
Not open for further replies.

ggoldberg

MIS
Feb 7, 2003
27
My application shows a list of transactions. When one of them is double-clicked, another form is opened that is an edit form for the selected transaction. Based on which user is logged on, I want to allow/disallow editing of this transaction data on the edit form. I use a filter to display the selected transaction, but I can't seem to disable editing of the data. I have tried to set me.allowEdits=false on the edit form, but it still lets me edit the data. What can I be doing wrong?

Thanks,

Gerry Goldberg
 
That line of code worked fine when I tested it. Where did you put the me.allowedits=false code?
 
I tried it in the form_open sub and also in the form_Load sub. In both cases, the form still let me make edit modifications.

Thanks,

Gerry Goldberg
 
I am not sure why its not working. Another thing that you could do if you can't get the allowedits code to work is lock all the fields on the form. You could use something like this:
Dim ctrl As Control
For Each ctrl In Me.Controls
With ctrl
Select Case .ControlType

Case acTextBox
ctrl.locked = true

End Select
End With
Next

HTH,
Eric
 
Hi,

Just one line of code will work perfect for you. Just open form in readonly mode like:

DoCmd.OpenForm "Form1", , , , acFormReadOnly



Hope this helps... :)
Hasu
(Trust on someone, someone will trust you!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top