We help IT Professionals succeed at work.

Getting an Update error everytime try to update field in a form

gigifarrow
gigifarrow used Ask the Experts™
on
When I try to change a field in my form I get an error that says,"Update or Cancel Update without add new or edit".

Based on what model you pick from the combo box,depends on what information is displayed. When I try to check one of the fields I get an error message.

This is the code that is  in the unbound combo box:

Action                             Argument
SearchForRecord   First, ="[Model] = " & "'" & [Screen].[ActiveControl] & "'"
Attached is  the form and table.
CheckMarkwithcode.accdb
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:

Author

Commented:
Thank you that does work could you please tell me what I was doing wrong?
Top Expert 2016
Commented:
i remove the [Event Procedure] in the current event of your form
did a Compact and Repair
thats it...

if you are making changes to your codes,
*make sure that the form is in design view
*always do a debug >compile and correct any errors raised before proceeding.

and don't forget to do a compact and repair

Author

Commented:
Okay but that event procedure is used to grey out the form fields based on the model number. Where would I put that procedure in the form?
Top Expert 2016

Commented:
i did not see any codes in the current event when i open your db..
what codes are supposed to run in that event?

can you post them here

Author

Commented:
Here is the code. It grays out based on the model number.




Private Sub Form_Current()
Me.verification.Enabled = True
Me.doorMod.Enabled = True
Me.AFESNewCEP.Enabled = True
Me.AFESNewCEPbracket.Enabled = True
Me.AFESBottleCableGuard.Enabled = True
Me.AFESCEPProtectiveSeitchGuard.Enabled = True
Me.AFESCEPBracketupgrade.Enabled = True
Me.AFESCEPGuard.Enabled = True
Me.BFISTChillerKits.Enabled = True
Me.BFISTBoresightStorage.Enabled = True
Me.BFTDualConfigBFTAKitInstalled.Enabled = True
Me.BFTAKitinstalled.Enabled = True
Me.BRATIIKinstalled.Enabled = True
Me.BRATIKitinstalled.Enabled = True
Me.BRATIIprovisioned.Enabled = True
Me.BRATIITilesinstalled.Enabled = True
Me.BUSKIACSKitHardwareImproved.Enabled = True
Me.BUSKIACSInstalledCorrectVariant.Enabled = True
Me.BUSKICommandersSpotlight.Enabled = True
Me.BUSKIPowerLineProtection.Enabled = True
Me.BUSKISightProtectiveCover.Enabled = True
Me.BUSKIIAFESinstalled.Enabled = True
Me.BUSKIIBFISTFSSOSeat.Enabled = True
Me.BUSKIIBFISTHotBox.Enabled = True
Me.BUSKIIBFISTJumpSeat.Enabled = True
Me.BUSKIACSKitHardwareImproved.Enabled = True
Me.BUSKIICrewBASSSeatsinstall.Enabled = True
Me.BUSKIIHotBoxModinstalled.Enabled = True
Me.BUSKIIIBASSDDriversSeatspacers.Enabled = True
Me.BUSKIIIBASSDinstalled.Enabled = True
Me.BUSKIIIBFCSinstalled.Enabled = True
Me.BUSKIIIERRinstalled.Enabled = True
Me.BUSKIIITASSinstalled.Enabled = True
Me.CREWAKitinstalled.Enabled = True
Me.CVRJAKitinstalled.Enabled = True
Me.DataplateUID.Enabled = True
Me.DeactivateSmokeGeneration.Enabled = True
Me.DoublepintrackXT.Enabled = True
Me.DriversSlaveStartDecal.Enabled = True
Me.EMIinstalled.Enabled = True
Me.FBCB2AKitinstalled.Enabled = True
Me.FloorSupportCracked.Enabled = True
Me.FS3AKitinstalled.Enabled = True
Me.FuelShutOffCablefireretardantsleeve.Enabled = True
Me.GunnersSeatBackRemoved.Enabled = True
Me.HAK.Enabled = True
Me.HAKProvisioned.Enabled = True
Me.HotBoxLiningRemoval.Enabled = True
Me.Stowage.Enabled = True
Me.ImprovedGeneratorGuard.Enabled = True
Me.Improvedtiedownshackle.Enabled = True
Me.MaintFreeRightAngleDrivedefective.Enabled = True
Me.MSSinstalled.Enabled = True
Me.NBCMaskConnectors.Enabled = True
Me.PLGRConnectorImproved.Enabled = True
Me.PLGRtoDAGRchangeover.Enabled = True
Me.SecondarySightRemoval.Enabled = True
Me.SINCGARSCableGuard.Enabled = True
Me.SLSDSwingArm.Enabled = True
Me.StiffenerCargoHatch.Enabled = True
Me.StiffenerCargoHatch.Enabled = True
Me.TrackAdjustercheckRequiredrepair.Enabled = True
Select Case Model
Case "A3 BFIST"
Me.HAK.Enabled = False
Me.HAKProvisioned.Enabled = False


Case "M2A2"
Me.BFISTChillerKits = False
Me.BUSKIIBFISTRestowageinstalled.Enabled = False
Me.BFTDualConfigBFTAKitInstalled.Enabled = False
Me.BUSKIIBFISTFSSOSeat.Enabled = False
Me.BUSKIIBFISTHotBox.Enabled = False
Me.BUSKIIBFISTJumpSeat.Enabled = False
Me.BUSKIACSKitHardwareImproved.Enabled = False
Me.BUSKIICrewBASSSeatsinstall.Enabled = False
Me.BUSKIIHotBoxModinstalled.Enabled = False
Me.BUSKIIIBASSDDriversSeatspacers.Enabled = False
Me.FS3AKitinstalled.Enabled = False

Case "M2A2 ODS"
Me.BFISTChillerKits.Enabled = False
Me.BUSKIIBFISTRestowageinstalled.Enabled = False
Me.BFTDualConfigBFTAKitInstalled.Enabled = False
Me.BUSKIIBFISTFSSOSeat.Enabled = False
Me.BUSKIIBFISTHotBox.Enabled = False
Me.BUSKIIBFISTJumpSeat.Enabled = False
Me.BUSKIACSKitHardwareImproved.Enabled = False
Me.BUSKIICrewBASSSeatsinstall.Enabled = False
Me.BUSKIIHotBoxModinstalled.Enabled = False
Me.BUSKIIIBASSDDriversSeatspacers.Enabled = False
Me.FS3AKitinstalled.Enabled = False

Case "M2A2 ODS SA"
Case "A3BFIST"
Me.HAK.Enabled = False
Me.HAKProvisioned.Enabled = False

Case "M2A3"
Me.BFISTChillerKits = False
Me.BUSKIIBFISTRestowageinstalled.Enabled = False
Me.BFTDualConfigBFTAKitInstalled.Enabled = False
Me.BUSKIIBFISTFSSOSeat.Enabled = False
Me.BUSKIIBFISTHotBox.Enabled = False
Me.BUSKIIBFISTJumpSeat.Enabled = False
Me.BUSKIACSKitHardwareImproved.Enabled = False
Me.BUSKIICrewBASSSeatsinstall.Enabled = False
Me.BUSKIIHotBoxModinstalled.Enabled = False
Me.BUSKIIIBASSDDriversSeatspacers.Enabled = False
Me.FS3AKitinstalled.Enabled = False

Case "M3A2"
Me.BFISTChillerKits = False
Me.BUSKIIBFISTRestowageinstalled.Enabled = False
Me.BFTDualConfigBFTAKitInstalled.Enabled = False
Me.BUSKIIBFISTFSSOSeat.Enabled = False
Me.BUSKIIBFISTHotBox.Enabled = False
Me.BUSKIIBFISTJumpSeat.Enabled = False
Me.BUSKIACSKitHardwareImproved.Enabled = False
Me.BUSKIICrewBASSSeatsinstall.Enabled = False
Me.BUSKIIHotBoxModinstalled.Enabled = False
Me.BUSKIIIBASSDDriversSeatspacers.Enabled = False
Me.FS3AKitinstalled.Enabled = False

Case "M3A2 ODS"
Me.BFISTChillerKits = False
Me.BUSKIIBFISTRestowageinstalled.Enabled = False
Me.BFTDualConfigBFTAKitInstalled.Enabled = False
Me.BUSKIIBFISTFSSOSeat.Enabled = False
Me.BUSKIIBFISTHotBox.Enabled = False
Me.BUSKIIBFISTJumpSeat.Enabled = False
Me.BUSKIACSKitHardwareImproved.Enabled = False
Me.BUSKIICrewBASSSeatsinstall.Enabled = False
Me.BUSKIIHotBoxModinstalled.Enabled = False
Me.BUSKIIIBASSDDriversSeatspacers.Enabled = False
Me.FS3AKitinstalled.Enabled = False

Case "M3A2 ODS SA"
Me.BFISTChillerKits = False
Me.BUSKIIBFISTRestowageinstalled.Enabled = False
Me.BFTDualConfigBFTAKitInstalled.Enabled = False
Me.BUSKIIBFISTFSSOSeat.Enabled = False
Me.BUSKIIBFISTHotBox.Enabled = False
Me.BUSKIIBFISTJumpSeat.Enabled = False
Me.BUSKIACSKitHardwareImproved.Enabled = False
Me.BUSKIICrewBASSSeatsinstall.Enabled = False
Me.BUSKIIHotBoxModinstalled.Enabled = False
Me.BUSKIIIBASSDDriversSeatspacers.Enabled = False
Me.FS3AKitinstalled.Enabled = False

Case "M3A3"

Case "M7 BFIST"
Me.HAK.Enabled = False
Me.HAKProvisioned.Enabled = False

Case "M7 BFIST SA"
Me.HAK.Enabled = False
Me.HAKProvisioned.Enabled = False



 
 End Select
 






End Sub
Top Expert 2016

Commented:

Author

Commented:
It works!! Thank you . When you get a chance and your not too busy. Could you please tell how you got it to work?
Top Expert 2016

Commented:
i already posted it above.. http:#a37852199