• Code

    Author
    Topic
    #457837

    I’ve used the SendObject macro and On Click procedure several times in my database. That has worked out so far but now they would like me to send an email notification if a combo box has “Accept” in it. Will you please tell me how to write the, I believe it would be a module that would say, if cboStatus = Accept then run mQuoteAccepted?

    Viewing 2 reply threads
    Author
    Replies
    • #1148980

      Let’s say you have a command button cmdSend. The On Click event procedure could look like this:

      Code:
      Private Sub cmdSend_Click()
        If Me.cboStatus = "Accept" Then
      	DoCmd.RunMacro "mQuoteAccepted"
        End If
      End Sub
    • #1149066

      I can rework the form if I need to but I want to double check…Do I need to add a button to the form? It is currently set up as a datasheet? I was hoping to run the macro anytime the text in the combo box says “Accept.”

      • #1149110

        I can rework the form if I need to but I want to double check…Do I need to add a button to the form? It is currently set up as a datasheet? I was hoping to run the macro anytime the text in the combo box says “Accept.”

        You could use the After Update event of the combo box instead, you wouldn’t need a button. Simply replace the first line of the code with

        Private Sub cboStatus_AfterUpdate()

    • #1149116

      Thank you Hans.

    Viewing 2 reply threads
    Reply To: Code

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: