Thanks for the response. Is there a way to ask the user if they want to print the report or not? Thanks again.
"Tom van Stiphout" wrote:
[Quoted Text] > On Wed, 10 Dec 2008 13:11:04 -0800, sue gray > <suegray[ at ]discussions.microsoft.com> wrote: > > Good question. Access provides for this as follows: > * In the Form_BeforeUpdate perform your checks like you are already > doing. If you detect an error condition, set the Cancel argument to > True. This will prevent the record from being saved, so the user can > fix it and try again. E.g.: > private sub Form_BeforeUpdate(Cancel as Boolean) > if Me.FirstName = "Tom" then > Msgbox "Yo! That's an illegal name. Fix it!" > Cancel = True > end if > end sub > > Then to run a report or perform any other action that depends on the > record being valid and saved, use the Form_AfterUpdate event: > private sub Form_AfterUpdate > DoCmd.OpenReport "myReport", WhereCondition:="CustomerID=" & > Me.CustomerID > end sub > > -Tom. > Microsoft Access MVP > > > >I have a subform that checks does some error checking in the Before UPdate > >Event. I seem to have that working ok. What I want to be able to do now is > >if the form passes all my error checks, I want to ask to print a report or > >not? Also, If this is a new record will the report be blank? Do I have to > >have some code to save the data, before printing. I'm not sure where to > >start on this. THanks in advance >
|