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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent from Adding new records

Status
Not open for further replies.

Form1

Programmer
Apr 27, 2005
12
I would like to prevent the user from entering new records
I used

With frm
.AllowAdditions = false
.AllowDeletions = True
.AllowEdits = True
End With

User should be able to update and edit.

If the form has no records then form will be blank. Form doesn't even show the controls.
How to make controls visible but user shoud not be allowed to enter new record. Is there any other solution for this?

thanks

 
Rather than setting the AllowAdditions property to false, couldn't you lock all the relevant controls on the form?

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks for the response

I want user to edit but prevent from entering new record.

If I lock all the controls on the form will
the user be able to edit?
 
Something Like this?
Code:
Private Sub Form_Load()
    If DCount("AnyFieldName", "TableName") = 0 Then
        With Me
            .AllowAdditions = True
            .AllowEdits = False
            .AllowDeletions = False
        End With
    Else
        With Me
            .AllowAdditions = False
            .AllowEdits = True
            .AllowDeletions = True
        End With
    End If
End Sub

________________________________________
Zameer Abdulla
Visit Me
A child may not be able to lift too much.
But it can certainly hold a marriage together
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top