form is overwriting table info

KristenD

Registered User.
Local time
Today, 09:16
Joined
Apr 2, 2012
Messages
394
I have a table that is set up as a pop up modal form based on a status. In one practice db I have the table works fine it collects the data. The other practice db I have set up in the exact same way, each time the table pops up the data that was previously in there and then overwrites it. The autonumber in the primary key never goes past one.

What am I doing wrong is the table set up incorrectly??? I posted in another thread but eventually figured out what the issue was before anyone answered.

Please help me with this!!!
 

Attachments

It is the form that pops up when the employee status is active. It is form Employee Entry and the pop up form is OSHA by Job.

Thank you!
 
OK so frmOSHA is a sub form and you wan to prevent the user overwriting existing records? You can prevent this by inserting the following code in the form's On Current event;
Code:
    If Me.NewRecord = False Then
        Me.AllowEdits = False
    Else
        Me.AllowEdits = True
    End If
This will prevent the user changing existing records but when the go to a new record they can enter new data. If you do need to allow the user to edit existing records you could put a Command Button titled Edit Current Record with the following code in it's On Click event;
Code:
Me.AllowEdits = True
 
Yes, OSHAByJob is a subform. Would I put the same code in for that that you put in below? It is not frmOSHA that is giving me trouble, it is the pop up form that relies on EmployeeStatus = "Active".

Thank you!
 
I figured it out. Allow Data Entry was set to "No". I missed it! I allowed data entry and hopefully it will work. I am attempting entry now.
 

Users who are viewing this thread

Back
Top Bottom