Check the AllowAdditions, AllowEdits, and DataEntry properties. They can be used in real-time to alter how the form displays.
For example, if you want the form to open "empty", ready for a NEW record to be added, set the DataEntry property to TRUE.
Sub Form_Open()
Me.DataEntry = TRUE
End Sub
In this mode, NEW records may be added, but once they're in, you won't be able to position to them and edit or maintain them. In other words, DATAENTRY means DATA ENTRY ONLY.
If later on, you'd like to display records on the form and allow for scrolling, editing, etc. simply place a button or something that can be clicked on, and code it thusly:
Sub btnMakeFormEditable_Click()
With ME
.DataEntry = false
.AllowEdits = TRUE
.AllowDeletions = TRUE
.Requery
End With
End Sub
There are a couple other of these Allow... guys in the form property sheet, I just don't remember them right now. Check it out.
Jim
Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at