Question : vba code to close form (with a subform) after user clicks on the back record navigation selector button

If there are records, the form with the subform opens up.  The user then clicks the record selector button (bottom left of the form with the arrows) one by one to incrementally move through the records, which automatically set values in the subform based on the values in the main form until the user hits the last record.  At that point, if the user starts to move backwards using the back record selector button, there are no more values to fill in the subform as they were already filled out in the first place when the user was moving forward using the forward record selector button.  So if the user decides to move backwards, I want a message saying that vaues already full or applied etc etc. and basically close the form.  That is all.  How do I get this form to close programatically using VBA?  The form is called "z CCR_ProblemCode_RGO" and the VBA code is attached behind it.  Thanks.

Answer : vba code to close form (with a subform) after user clicks on the back record navigation selector button

If you need this much control over your user's movements, then don't use the builtin navigation buttons and instead build your own. Here's a small database that shows how to do this. The code in this database makes use of Form Properties and such to communicate between the navigation function and the "calling" form. If you need to move this sort of code into your database, then copy the basNavigation module to your database, and add the Properties found in fBooks to your form. You would then add buttons like are on fBooks to move around in your form.

 
Navigation Buttons - 2003 format
 
Random Solutions  
 
programming4us programming4us