save record and then if statement

Muzicmn

Registered User.
Local time
Today, 16:34
Joined
Nov 3, 2002
Messages
78
Hi,

what i am trying to do is save a record and then apply an if statement at the push of a button. I am sure its easy to do but cant seem to figure it out. When i apply the following code i get an error saying "expected end sub"

How can i get around this

Private Sub Command25_Click()
DoCmd.RunCommand acCmdSaveRecord
If Forms!frmmbiinfo.PROCESSED = False Then DoCmd.RunMacro "MCROAREAASSIGNMENT"
Private Sub Command25_Enter()
End Sub

Thanks

Ricky
 
Your missing an End Sub between these lines
If Forms!frmmbiinfo.PROCESSED = False Then DoCmd.RunMacro "MCROAREAASSIGNMENT"
Private Sub Command25_Enter()
 
Just what it says. You are missing the "end sub"

Code:
Private Sub Command25_Click()
    DoCmd.RunCommand acCmdSaveRecord
    If Forms!frmmbiinfo.PROCESSED = False Then DoCmd.RunMacro "MCROAREAASSIGNMENT"
[b]End Sub[/b]


Private Sub Command25_Enter()
End Sub

You should delete the last two lines since there is no code associated with them.
 

Users who are viewing this thread

Back
Top Bottom