Solved Allow adding a new record while restricting existing records on a popup form (1 Viewer)

slharman1

Member
Local time
Today, 12:45
Joined
Mar 8, 2021
Messages
476
I have a popup form that lists records and has these fields:
CompID
Qty
Date
OrderDetID
I want to restrict the user from editing the existing records while still allowing them to add the new record.

Not sure how to go about this
Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:45
Joined
Oct 29, 2018
Messages
21,496
I am thinking using the Current Event would play into this. For example, in the Current Event, check if you are on a New Record. If so, allow edits; otherwise, disable it.
 

slharman1

Member
Local time
Today, 12:45
Joined
Mar 8, 2021
Messages
476
I am thinking using the Current Event would play into this. For example, in the Current Event, check if you are on a New Record. If so, allow edits; otherwise, disable it.
Thanks
How would i code this?
 

moke123

AWF VIP
Local time
Today, 13:45
Joined
Jan 11, 2013
Messages
3,928
Code:
Private Sub Form_Current()
    Me.AllowEdits = Me.NewRecord
End Sub
 

Users who are viewing this thread

Top Bottom