Results 1 to 5 of 5

Thread: Code

  1. #1
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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

  3. #3
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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."

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='Theresa01' post='761925' date='26-Feb-09 20:17']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."[/quote]
    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()

  5. #5
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •