I have setup a button with an event procedure behind it. I need to
edit the vba code so it will ask me which email address to use if
there is more than one email field filled. The email fields to pick
from would be: serviceremail or serviceremail2
Here is the code I currently have that works for the first email only:
Private Sub WorkOrderMissing_Click()
On Error GoTo ErrorHandler
Dim objOutlook As Object 'Outlook.Application
Dim objMailItem As Object 'Outlook.MailItem
Dim WaitingFor As String
Set objOutlook = CreateObject("Outlook.Application")
Set objMailItem = objOutlook.CreateItem(0)
DoCmd.RunCommand acCmdSaveRecord
WaitingFor = Me!serviceremail
With objMailItem
.To = WaitingFor
.Subject = "Missing Work Order SO# " & [WorkOrder#]
.body = "We have not received the signed work order for the
call referenced at the bottom of this message. Please make sure you
have done one of the following:" & Chr(13) & "Scan and email the work
order to: completed@serviceenvoy.com" & Chr(13) & "or" & Chr(13) &
"Fax the signed work order to: 888-858-2846 or 817-394-4236" & Chr(13)
& Chr(13) & "No other email addresses or fax numbers are valid closing
methods." & Chr(13) & "If you think you have already sent the work
order in via one of the above methods, please resend it. I have just
looked in my database and it wasn't received. Please resend the work
order and feel free to call or email to make sure we receive it this
time." & Chr(13) & "Please remember, we must receive the signed work
order before we can close the call and pay you." & Chr(13) & Chr(13) &
[CallData] & Chr(13) & Chr(13) & "Michael Firey" & Chr(13) & "Service
Envoy, LLC" & Chr(13) & "918-398-4236" & Chr(13) &
"completed@serviceenvoy.com" & Chr(13) & "www.serviceenvoy.com"
.display
End With
Exit Sub
ErrorHandler:
MsgBox "Error Number: " & Err.Number & " " & Err.Description
End Sub
|
|
0
|
|
|
|
Reply
|
ServiceEnvoy
|
9/28/2007 8:50:06 PM |
|
It all starts with the data. We aren't there -- we can't see your data
structure.
How is it that you can have "more than one email field filled"? Does that
mean your table has multiple (repeating) fields for the same kind of data
(e.g., email address)?
Regards
Jeff Boyce
Microsoft Office/Access MVP
"ServiceEnvoy" <serviceenvoy@gmail.com> wrote in message
news:1191012606.859863.72600@n39g2000hsh.googlegroups.com...
>I have setup a button with an event procedure behind it. I need to
> edit the vba code so it will ask me which email address to use if
> there is more than one email field filled. The email fields to pick
> from would be: serviceremail or serviceremail2
>
>
> Here is the code I currently have that works for the first email only:
>
> Private Sub WorkOrderMissing_Click()
> On Error GoTo ErrorHandler
>
> Dim objOutlook As Object 'Outlook.Application
> Dim objMailItem As Object 'Outlook.MailItem
> Dim WaitingFor As String
>
>
>
> Set objOutlook = CreateObject("Outlook.Application")
> Set objMailItem = objOutlook.CreateItem(0)
>
> DoCmd.RunCommand acCmdSaveRecord
> WaitingFor = Me!serviceremail
> With objMailItem
>
> .To = WaitingFor
> .Subject = "Missing Work Order SO# " & [WorkOrder#]
> .body = "We have not received the signed work order for the
> call referenced at the bottom of this message. Please make sure you
> have done one of the following:" & Chr(13) & "Scan and email the work
> order to: completed@serviceenvoy.com" & Chr(13) & "or" & Chr(13) &
> "Fax the signed work order to: 888-858-2846 or 817-394-4236" & Chr(13)
> & Chr(13) & "No other email addresses or fax numbers are valid closing
> methods." & Chr(13) & "If you think you have already sent the work
> order in via one of the above methods, please resend it. I have just
> looked in my database and it wasn't received. Please resend the work
> order and feel free to call or email to make sure we receive it this
> time." & Chr(13) & "Please remember, we must receive the signed work
> order before we can close the call and pay you." & Chr(13) & Chr(13) &
> [CallData] & Chr(13) & Chr(13) & "Michael Firey" & Chr(13) & "Service
> Envoy, LLC" & Chr(13) & "918-398-4236" & Chr(13) &
> "completed@serviceenvoy.com" & Chr(13) & "www.serviceenvoy.com"
> .display
> End With
>
> Exit Sub
> ErrorHandler:
> MsgBox "Error Number: " & Err.Number & " " & Err.Description
> End Sub
>
|
|
0
|
|
|
|
Reply
|
Jeff
|
9/28/2007 11:57:23 PM
|
|
On Sep 28, 6:57 pm, "Jeff Boyce" <nonse...@nonsense.com> wrote:
> It all starts with the data. We aren't there -- we can't see your data
> structure.
>
> How is it that you can have "more than one email field filled"? Does that
> mean your table has multiple (repeating) fields for the same kind of data
> (e.g., email address)?
>
> Regards
>
> Jeff Boyce
> Microsoft Office/Access MVP
>
> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>
> news:1191012606.859863.72600@n39g2000hsh.googlegroups.com...
>
> >I have setup a button with an event procedure behind it. I need to
> > edit the vba code so it will ask me which email address to use if
> > there is more than one email field filled. The email fields to pick
> > from would be: serviceremail or serviceremail2
>
> > Here is the code I currently have that works for the first email only:
>
> > Private Sub WorkOrderMissing_Click()
> > On Error GoTo ErrorHandler
>
> > Dim objOutlook As Object 'Outlook.Application
> > Dim objMailItem As Object 'Outlook.MailItem
> > Dim WaitingFor As String
>
> > Set objOutlook = CreateObject("Outlook.Application")
> > Set objMailItem = objOutlook.CreateItem(0)
>
> > DoCmd.RunCommand acCmdSaveRecord
> > WaitingFor = Me!serviceremail
> > With objMailItem
>
> > .To = WaitingFor
> > .Subject = "Missing Work Order SO# " & [WorkOrder#]
> > .body = "We have not received the signed work order for the
> > call referenced at the bottom of this message. Please make sure you
> > have done one of the following:" & Chr(13) & "Scan and email the work
> > order to: comple...@serviceenvoy.com" & Chr(13) & "or" & Chr(13) &
> > "Fax the signed work order to: 888-858-2846 or 817-394-4236" & Chr(13)
> > & Chr(13) & "No other email addresses or fax numbers are valid closing
> > methods." & Chr(13) & "If you think you have already sent the work
> > order in via one of the above methods, please resend it. I have just
> > looked in my database and it wasn't received. Please resend the work
> > order and feel free to call or email to make sure we receive it this
> > time." & Chr(13) & "Please remember, we must receive the signed work
> > order before we can close the call and pay you." & Chr(13) & Chr(13) &
> > [CallData] & Chr(13) & Chr(13) & "Michael Firey" & Chr(13) & "Service
> > Envoy, LLC" & Chr(13) & "918-398-4236" & Chr(13) &
> > "comple...@serviceenvoy.com" & Chr(13) & "www.serviceenvoy.com"
> > .display
> > End With
>
> > Exit Sub
> > ErrorHandler:
> > MsgBox "Error Number: " & Err.Number & " " & Err.Description
> > End Sub
I have 3 different fields for "servicers" which can be assigned to a
ticket. Each field is named progressively, servicer1, servicer2,
servicer3. When we enter them, I have an after update option that
automatically loads their respective email address into the fields,
email1, email2, email3.
|
|
0
|
|
|
|
Reply
|
ServiceEnvoy
|
10/1/2007 2:55:02 PM
|
|
You will find that you (and Access) have to work much harder and come up
with "work arounds" to deal with the data structure you've described.
A well-normalized relational database design would reflect the fact ("fact",
in your situation) that there can be more than one email address associated
with whatever entity. Rather than pressing forward to develop a
work-around, consider creating a table structure that makes better use of
Access' relationally-oriented features and functions. That is, create a
"many" table that holds one record for each valid entity-email pair.
Regards
Jeff Boyce
Microsoft Office/Access MVP
"ServiceEnvoy" <serviceenvoy@gmail.com> wrote in message
news:1191250502.388699.115950@o80g2000hse.googlegroups.com...
> On Sep 28, 6:57 pm, "Jeff Boyce" <nonse...@nonsense.com> wrote:
>> It all starts with the data. We aren't there -- we can't see your data
>> structure.
>>
>> How is it that you can have "more than one email field filled"? Does
>> that
>> mean your table has multiple (repeating) fields for the same kind of data
>> (e.g., email address)?
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Office/Access MVP
>>
>> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>>
>> news:1191012606.859863.72600@n39g2000hsh.googlegroups.com...
>>
>> >I have setup a button with an event procedure behind it. I need to
>> > edit the vba code so it will ask me which email address to use if
>> > there is more than one email field filled. The email fields to pick
>> > from would be: serviceremail or serviceremail2
>>
>> > Here is the code I currently have that works for the first email only:
>>
>> > Private Sub WorkOrderMissing_Click()
>> > On Error GoTo ErrorHandler
>>
>> > Dim objOutlook As Object 'Outlook.Application
>> > Dim objMailItem As Object 'Outlook.MailItem
>> > Dim WaitingFor As String
>>
>> > Set objOutlook = CreateObject("Outlook.Application")
>> > Set objMailItem = objOutlook.CreateItem(0)
>>
>> > DoCmd.RunCommand acCmdSaveRecord
>> > WaitingFor = Me!serviceremail
>> > With objMailItem
>>
>> > .To = WaitingFor
>> > .Subject = "Missing Work Order SO# " & [WorkOrder#]
>> > .body = "We have not received the signed work order for the
>> > call referenced at the bottom of this message. Please make sure you
>> > have done one of the following:" & Chr(13) & "Scan and email the work
>> > order to: comple...@serviceenvoy.com" & Chr(13) & "or" & Chr(13) &
>> > "Fax the signed work order to: 888-858-2846 or 817-394-4236" & Chr(13)
>> > & Chr(13) & "No other email addresses or fax numbers are valid closing
>> > methods." & Chr(13) & "If you think you have already sent the work
>> > order in via one of the above methods, please resend it. I have just
>> > looked in my database and it wasn't received. Please resend the work
>> > order and feel free to call or email to make sure we receive it this
>> > time." & Chr(13) & "Please remember, we must receive the signed work
>> > order before we can close the call and pay you." & Chr(13) & Chr(13) &
>> > [CallData] & Chr(13) & Chr(13) & "Michael Firey" & Chr(13) & "Service
>> > Envoy, LLC" & Chr(13) & "918-398-4236" & Chr(13) &
>> > "comple...@serviceenvoy.com" & Chr(13) & "www.serviceenvoy.com"
>> > .display
>> > End With
>>
>> > Exit Sub
>> > ErrorHandler:
>> > MsgBox "Error Number: " & Err.Number & " " & Err.Description
>> > End Sub
>
> I have 3 different fields for "servicers" which can be assigned to a
> ticket. Each field is named progressively, servicer1, servicer2,
> servicer3. When we enter them, I have an after update option that
> automatically loads their respective email address into the fields,
> email1, email2, email3.
>
|
|
0
|
|
|
|
Reply
|
Jeff
|
10/1/2007 3:45:00 PM
|
|
On Oct 1, 10:45 am, "Jeff Boyce" <nonse...@nonsense.com> wrote:
> You will find that you (and Access) have to work much harder and come up
> with "work arounds" to deal with the data structure you've described.
>
> A well-normalized relational database design would reflect the fact ("fact",
> in your situation) that there can be more than one email address associated
> with whatever entity. Rather than pressing forward to develop a
> work-around, consider creating a table structure that makes better use of
> Access' relationally-oriented features and functions. That is, create a
> "many" table that holds one record for each valid entity-email pair.
>
> Regards
>
> Jeff Boyce
> Microsoft Office/Access MVP
>
> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>
> news:1191250502.388699.115950@o80g2000hse.googlegroups.com...
>
> > On Sep 28, 6:57 pm, "Jeff Boyce" <nonse...@nonsense.com> wrote:
> >> It all starts with the data. We aren't there -- we can't see your data
> >> structure.
>
> >> How is it that you can have "more than one email field filled"? Does
> >> that
> >> mean your table has multiple (repeating) fields for the same kind of data
> >> (e.g., email address)?
>
> >> Regards
>
> >> Jeff Boyce
> >> Microsoft Office/Access MVP
>
> >> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>
> >>news:1191012606.859863.72600@n39g2000hsh.googlegroups.com...
>
> >> >I have setup a button with an event procedure behind it. I need to
> >> > edit the vba code so it will ask me which email address to use if
> >> > there is more than one email field filled. The email fields to pick
> >> > from would be: serviceremail or serviceremail2
>
> >> > Here is the code I currently have that works for the first email only:
>
> >> > Private Sub WorkOrderMissing_Click()
> >> > On Error GoTo ErrorHandler
>
> >> > Dim objOutlook As Object 'Outlook.Application
> >> > Dim objMailItem As Object 'Outlook.MailItem
> >> > Dim WaitingFor As String
>
> >> > Set objOutlook = CreateObject("Outlook.Application")
> >> > Set objMailItem = objOutlook.CreateItem(0)
>
> >> > DoCmd.RunCommand acCmdSaveRecord
> >> > WaitingFor = Me!serviceremail
> >> > With objMailItem
>
> >> > .To = WaitingFor
> >> > .Subject = "Missing Work Order SO# " & [WorkOrder#]
> >> > .body = "We have not received the signed work order for the
> >> > call referenced at the bottom of this message. Please make sure you
> >> > have done one of the following:" & Chr(13) & "Scan and email the work
> >> > order to: comple...@serviceenvoy.com" & Chr(13) & "or" & Chr(13) &
> >> > "Fax the signed work order to: 888-858-2846 or 817-394-4236" & Chr(13)
> >> > & Chr(13) & "No other email addresses or fax numbers are valid closing
> >> > methods." & Chr(13) & "If you think you have already sent the work
> >> > order in via one of the above methods, please resend it. I have just
> >> > looked in my database and it wasn't received. Please resend the work
> >> > order and feel free to call or email to make sure we receive it this
> >> > time." & Chr(13) & "Please remember, we must receive the signed work
> >> > order before we can close the call and pay you." & Chr(13) & Chr(13) &
> >> > [CallData] & Chr(13) & Chr(13) & "Michael Firey" & Chr(13) & "Service
> >> > Envoy, LLC" & Chr(13) & "918-398-4236" & Chr(13) &
> >> > "comple...@serviceenvoy.com" & Chr(13) & "www.serviceenvoy.com"
> >> > .display
> >> > End With
>
> >> > Exit Sub
> >> > ErrorHandler:
> >> > MsgBox "Error Number: " & Err.Number & " " & Err.Description
> >> > End Sub
>
> > I have 3 different fields for "servicers" which can be assigned to a
> > ticket. Each field is named progressively, servicer1, servicer2,
> > servicer3. When we enter them, I have an after update option that
> > automatically loads their respective email address into the fields,
> > email1, email2, email3.
I've done my best to normalize in every place I can. However, I don't
believe I can use a subform for this use. If we were to use a
subform, we could not filter for tickets assigned to that servicer nor
could we setup double click and after update events to happen based on
those servicer and related email fields located in the subform. Now,
if I'm ignorant of something here where these things can be done with
a subform then I'm a student ready to learn. Please enlighten me.
Otherwise, I have to work with my data this way.
To make it as simple as possible, I set up the following related
fields:
servicer1ID servicer1name servicer1email
servicer2ID servicer2name servicer2email
servicer3id servicer3name servicer3email
This allows us to have up to 3 different servicer assigned to one
ticket and has served our needs to this point. I have an auto update
that inserts the servicer name and email address based on the unique
id selected. I have also setup the command button I was asking about
which will do what we want for servicer1. I just didn't know if there
might be a way to make the button ask us which servicer email to apply
the command to. If not, of course, I can make 3 sets of buttons for
the 3 servicers.
I'm willing to expand my knowledge and alter the way I'm doing things
but I'm a relative novice so whatever you suggest needs to come with
detailed explanations.
|
|
0
|
|
|
|
Reply
|
ServiceEnvoy
|
10/2/2007 4:37:30 AM
|
|
Oh, You can
The Parent Form is available through the Parent Property of the SubForm
ie
Private subEmail_Click()
Me.Parent.Email.Value = Me.subEmail.Value
End Sub
HtH
Pieter
"ServiceEnvoy" <serviceenvoy@gmail.com> wrote in message
news:1191299850.469075.166990@w3g2000hsg.googlegroups.com...
> On Oct 1, 10:45 am, "Jeff Boyce" <nonse...@nonsense.com> wrote:
>> You will find that you (and Access) have to work much harder and come up
>> with "work arounds" to deal with the data structure you've described.
>>
>> A well-normalized relational database design would reflect the fact
>> ("fact",
>> in your situation) that there can be more than one email address
>> associated
>> with whatever entity. Rather than pressing forward to develop a
>> work-around, consider creating a table structure that makes better use of
>> Access' relationally-oriented features and functions. That is, create a
>> "many" table that holds one record for each valid entity-email pair.
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Office/Access MVP
>>
>> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>>
>> news:1191250502.388699.115950@o80g2000hse.googlegroups.com...
>>
>> > On Sep 28, 6:57 pm, "Jeff Boyce" <nonse...@nonsense.com> wrote:
>> >> It all starts with the data. We aren't there -- we can't see your
>> >> data
>> >> structure.
>>
>> >> How is it that you can have "more than one email field filled"? Does
>> >> that
>> >> mean your table has multiple (repeating) fields for the same kind of
>> >> data
>> >> (e.g., email address)?
>>
>> >> Regards
>>
>> >> Jeff Boyce
>> >> Microsoft Office/Access MVP
>>
>> >> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>>
>> >>news:1191012606.859863.72600@n39g2000hsh.googlegroups.com...
>>
>> >> >I have setup a button with an event procedure behind it. I need to
>> >> > edit the vba code so it will ask me which email address to use if
>> >> > there is more than one email field filled. The email fields to pick
>> >> > from would be: serviceremail or serviceremail2
>>
>> >> > Here is the code I currently have that works for the first email
>> >> > only:
>>
>> >> > Private Sub WorkOrderMissing_Click()
>> >> > On Error GoTo ErrorHandler
>>
>> >> > Dim objOutlook As Object 'Outlook.Application
>> >> > Dim objMailItem As Object 'Outlook.MailItem
>> >> > Dim WaitingFor As String
>>
>> >> > Set objOutlook = CreateObject("Outlook.Application")
>> >> > Set objMailItem = objOutlook.CreateItem(0)
>>
>> >> > DoCmd.RunCommand acCmdSaveRecord
>> >> > WaitingFor = Me!serviceremail
>> >> > With objMailItem
>>
>> >> > .To = WaitingFor
>> >> > .Subject = "Missing Work Order SO# " & [WorkOrder#]
>> >> > .body = "We have not received the signed work order for
>> >> > the
>> >> > call referenced at the bottom of this message. Please make sure you
>> >> > have done one of the following:" & Chr(13) & "Scan and email the
>> >> > work
>> >> > order to: comple...@serviceenvoy.com" & Chr(13) & "or" & Chr(13) &
>> >> > "Fax the signed work order to: 888-858-2846 or 817-394-4236" &
>> >> > Chr(13)
>> >> > & Chr(13) & "No other email addresses or fax numbers are valid
>> >> > closing
>> >> > methods." & Chr(13) & "If you think you have already sent the work
>> >> > order in via one of the above methods, please resend it. I have
>> >> > just
>> >> > looked in my database and it wasn't received. Please resend the work
>> >> > order and feel free to call or email to make sure we receive it this
>> >> > time." & Chr(13) & "Please remember, we must receive the signed work
>> >> > order before we can close the call and pay you." & Chr(13) & Chr(13)
>> >> > &
>> >> > [CallData] & Chr(13) & Chr(13) & "Michael Firey" & Chr(13) &
>> >> > "Service
>> >> > Envoy, LLC" & Chr(13) & "918-398-4236" & Chr(13) &
>> >> > "comple...@serviceenvoy.com" & Chr(13) & "www.serviceenvoy.com"
>> >> > .display
>> >> > End With
>>
>> >> > Exit Sub
>> >> > ErrorHandler:
>> >> > MsgBox "Error Number: " & Err.Number & " " & Err.Description
>> >> > End Sub
>>
>> > I have 3 different fields for "servicers" which can be assigned to a
>> > ticket. Each field is named progressively, servicer1, servicer2,
>> > servicer3. When we enter them, I have an after update option that
>> > automatically loads their respective email address into the fields,
>> > email1, email2, email3.
>
> I've done my best to normalize in every place I can. However, I don't
> believe I can use a subform for this use. If we were to use a
> subform, we could not filter for tickets assigned to that servicer nor
> could we setup double click and after update events to happen based on
> those servicer and related email fields located in the subform. Now,
> if I'm ignorant of something here where these things can be done with
> a subform then I'm a student ready to learn. Please enlighten me.
> Otherwise, I have to work with my data this way.
>
> To make it as simple as possible, I set up the following related
> fields:
>
> servicer1ID servicer1name servicer1email
> servicer2ID servicer2name servicer2email
> servicer3id servicer3name servicer3email
>
> This allows us to have up to 3 different servicer assigned to one
> ticket and has served our needs to this point. I have an auto update
> that inserts the servicer name and email address based on the unique
> id selected. I have also setup the command button I was asking about
> which will do what we want for servicer1. I just didn't know if there
> might be a way to make the button ask us which servicer email to apply
> the command to. If not, of course, I can make 3 sets of buttons for
> the 3 servicers.
>
> I'm willing to expand my knowledge and alter the way I'm doing things
> but I'm a relative novice so whatever you suggest needs to come with
> detailed explanations.
>
|
|
0
|
|
|
|
Reply
|
Pieter
|
10/2/2007 8:46:49 AM
|
|
On Oct 2, 3:46 am, "Pieter Wijnen"
<it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.ple...@online.replace.with.norway>
wrote:
> Oh, You can
> The Parent Form is available through the Parent Property of the SubForm
> ie
>
> Private subEmail_Click()
> Me.Parent.Email.Value = Me.subEmail.Value
> End Sub
>
> HtH
>
> Pieter
>
> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>
> news:1191299850.469075.166990@w3g2000hsg.googlegroups.com...
>
> > On Oct 1, 10:45 am, "Jeff Boyce" <nonse...@nonsense.com> wrote:
> >> You will find that you (and Access) have to work much harder and come up
> >> with "work arounds" to deal with the data structure you've described.
>
> >> A well-normalized relational database design would reflect the fact
> >> ("fact",
> >> in your situation) that there can be more than one email address
> >> associated
> >> with whatever entity. Rather than pressing forward to develop a
> >> work-around, consider creating a table structure that makes better use of
> >> Access' relationally-oriented features and functions. That is, create a
> >> "many" table that holds one record for each valid entity-email pair.
>
> >> Regards
>
> >> Jeff Boyce
> >> Microsoft Office/Access MVP
>
> >> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>
> >>news:1191250502.388699.115950@o80g2000hse.googlegroups.com...
>
> >> > On Sep 28, 6:57 pm, "Jeff Boyce" <nonse...@nonsense.com> wrote:
> >> >> It all starts with the data. We aren't there -- we can't see your
> >> >> data
> >> >> structure.
>
> >> >> How is it that you can have "more than one email field filled"? Does
> >> >> that
> >> >> mean your table has multiple (repeating) fields for the same kind of
> >> >> data
> >> >> (e.g., email address)?
>
> >> >> Regards
>
> >> >> Jeff Boyce
> >> >> Microsoft Office/Access MVP
>
> >> >> "ServiceEnvoy" <serviceen...@gmail.com> wrote in message
>
> >> >>news:1191012606.859863.72600@n39g2000hsh.googlegroups.com...
>
> >> >> >I have setup a button with an event procedure behind it. I need to
> >> >> > edit the vba code so it will ask me which email address to use if
> >> >> > there is more than one email field filled. The email fields to pick
> >> >> > from would be: serviceremail or serviceremail2
>
> >> >> > Here is the code I currently have that works for the first email
> >> >> > only:
>
> >> >> > Private Sub WorkOrderMissing_Click()
> >> >> > On Error GoTo ErrorHandler
>
> >> >> > Dim objOutlook As Object 'Outlook.Application
> >> >> > Dim objMailItem As Object 'Outlook.MailItem
> >> >> > Dim WaitingFor As String
>
> >> >> > Set objOutlook = CreateObject("Outlook.Application")
> >> >> > Set objMailItem = objOutlook.CreateItem(0)
>
> >> >> > DoCmd.RunCommand acCmdSaveRecord
> >> >> > WaitingFor = Me!serviceremail
> >> >> > With objMailItem
>
> >> >> > .To = WaitingFor
> >> >> > .Subject = "Missing Work Order SO# " & [WorkOrder#]
> >> >> > .body = "We have not received the signed work order for
> >> >> > the
> >> >> > call referenced at the bottom of this message. Please make sure you
> >> >> > have done one of the following:" & Chr(13) & "Scan and email the
> >> >> > work
> >> >> > order to: comple...@serviceenvoy.com" & Chr(13) & "or" & Chr(13) &
> >> >> > "Fax the signed work order to: 888-858-2846 or 817-394-4236" &
> >> >> > Chr(13)
> >> >> > & Chr(13) & "No other email addresses or fax numbers are valid
> >> >> > closing
> >> >> > methods." & Chr(13) & "If you think you have already sent the work
> >> >> > order in via one of the above methods, please resend it. I have
> >> >> > just
> >> >> > looked in my database and it wasn't received. Please resend the work
> >> >> > order and feel free to call or email to make sure we receive it this
> >> >> > time." & Chr(13) & "Please remember, we must receive the signed work
> >> >> > order before we can close the call and pay you." & Chr(13) & Chr(13)
> >> >> > &
> >> >> > [CallData] & Chr(13) & Chr(13) & "Michael Firey" & Chr(13) &
> >> >> > "Service
> >> >> > Envoy, LLC" & Chr(13) & "918-398-4236" & Chr(13) &
> >> >> > "comple...@serviceenvoy.com" & Chr(13) & "www.serviceenvoy.com"
> >> >> > .display
> >> >> > End With
>
> >> >> > Exit Sub
> >> >> > ErrorHandler:
> >> >> > MsgBox "Error Number: " & Err.Number & " " & Err.Description
> >> >> > End Sub
>
> >> > I have 3 different fields for "servicers" which can be assigned to a
> >> > ticket. Each field is named progressively, servicer1, servicer2,
> >> > servicer3. When we enter them, I have an after update option that
> >> > automatically loads their respective email address into the fields,
> >> > email1, email2, email3.
>
> > I've done my best to normalize in every place I can. However, I don't
> > believe I can use a subform for this use. If we were to use a
> > subform, we could not filter for tickets assigned to that servicer nor
> > could we setup double click and after update events to happen based on
> > those servicer and related email fields located in the subform. Now,
> > if I'm ignorant of something here where these things can be done with
> > a subform then I'm a student ready to learn. Please enlighten me.
> > Otherwise, I have to work with my data this way.
>
> > To make it as simple as possible, I set up the following related
> > fields:
>
> > servicer1ID servicer1name servicer1email
> > servicer2ID servicer2name servicer2email
> > servicer3id servicer3name servicer3email
>
> > This allows us to have up to 3 different servicer assigned to one
> > ticket and has served our needs to this point. I have an auto update
> > that inserts the servicer name and email address based on the unique
> > id selected. I have also setup the command button I was asking about
> > which will do what we want for servicer1. I just didn't know if there
> > might be a way to make the button ask us which servicer email to apply
> > the command to. If not, of course, I can make 3 sets of buttons for
> > the 3 servicers.
>
> > I'm willing to expand my knowledge and alter the way I'm doing things
> > but I'm a relative novice so whatever you suggest needs to come with
> > detailed explanations.
Ah.....that's useful to know. Can you filter for things in a subform
across the entire table like you would a regular field on the main
form?
|
|
0
|
|
|
|
Reply
|
ServiceEnvoy
|
10/2/2007 3:40:58 PM
|
|
|
6 Replies
116 Views
(page loaded in 0.205 seconds)
Similiar Articles: Retrieve query fields in a VBA variable - microsoft.public.access ...Using a field name as variable in a query - microsoft.public ... ... Database with Startup Options Visual Basic for Applications ... Using a VBA Variable to Filter a Query ... VBA Calculation with Variables - microsoft.public.excel ...Mike Yes D:\Mike\Calculation.XLS ... Database with Startup Options Visual Basic for Applications ... Using a VBA Variable to Filter a Query ... DocVariable wont work - microsoft.public.word.vba.general ...You must use code (vba) to assign a value to the variable and you may need to update the ... Word 2003 VBA to limit options in Inputbox to those in drop down ... ... Passing option group value to vba function - microsoft.public ...I've got 2 options named option1 and option2 ... How to set the value of a VBA variable with a ... you can call it like ... in Microsoft Visual Basic for Applications ... Determine data types from VBA - microsoft.public.access ...Visual Basic for Applications (VBA) Forum (recent ... ... accoding to LISTBOX multiple choices ... the variable: Function Get_Variable_Type ... Visual Basic for Applications ... FormulaR1C1 using variables - microsoft.public.excel.programming ...... but can't: ActiveCell.FormulaR1C1 = "=MyFunction(R[variable]C[variable])" What are my options? ... ... J2 stored in it. in VBA I'm using this code: cell ... new worksheet ... Pass parameter to launch batch file with variable from excel ...I am using a variable in the batch file so that I can pass a ... What are my options here? Do I need to run some macro or VBA to get this simple hyperlink to pass the ... UserForm and ordering variables - microsoft.public.outlook.program ...Set FormName with variable in VBA - microsoft.public.access.forms ... UserForm and ... I have created a userform that allows the user to select a variety of options in ... Input Form Field Names in VBA - microsoft.public.access.forms ...Sure, just declare a variable in the current ... Word 2003 VBA to limit options in Inputbox to those in ... calculate automatically in your Visual Basic for Applications ... How can I read CSV file using VBA? - microsoft.public.access ...With advance options I could see that my csv file ... Input #1, TextLine ' Read line into variable. ... Microsoft Excel and it's possible to get Visual Basic for Applications ... Using a VBA Variable to Filter a Query in Access 2007... 2007 query by using a fixed expression, a built-in VBA function, or a VBA variable of a ... To begin, open frmScores, a form that gives you a choice between a randomly ... Declaring VariablesIn the VBA Editor, go to the Tools menu, choose Options and then select the Editor tab, shown below. There, check the Require Variable Declaration option. Excel VBA Variables. Using Variables in Excel VBA Macro CodeExcel VBA Variables. Using Variables in Excel VBA ... 3) A Variable name cannot be the same as any one of Excel's ... Free Choice of Complete Excel Training Course OR Excel ... Excel VBA Variables - Easy Excel MacrosHow to declare, initialize and display an Excel VBA variable. A variable is used to store a value. A variable can be of any type. In Excel VBA we have variables of ... Excel VBA Date Variable Type | eHow.comExcel VBA Date Variable Type. Microsoft Excel provides a wide range of date and time programming functions in its Visual Basic for Applications ... Ad Choices en-US 7/18/2012 4:37:49 PM
|