Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hang on, how have you made the delete button work? Can you post the code? Hopefully you're not just blanking out all the fields (or are you???)It should go to the first record but it don't. It wants to go into add mode for some reason
[blue] DoCmd.Close
DoCmd.OpenForm "frmAddProducts"[/blue]
[blue] If Status = acDeleteOK Then Me.Requery[/blue]
[blue]I get the orignal error [purple]index or primary key can't be blank.[/purple][/blue]
Problem is I've eliminated all the code you posted as suspect!TheAceMan said:[blue]For the above to occur, [purple]a record has to have been edited (form in edit mode) and/or an attempt to save that record[/purple] occured with a [purple]blank field[/purple] that has its [purple]Required Property set to Yes[/purple] in its respective table.
Note: Writing to controls thru VBA [purple]does not put the form in edit mode.[/purple] Its the same as setting a Default![/blue]
Using it in other events (unless there's one I'm missing) is ambiguous . . . .TheAceMan said:[blue]The [purple]Status[/purple] arguement is specific to the [purple]AfterDelConfirm[/purple] event![/blue]