Benjamin Bolduc
Registered User.
- Local time
- Today, 10:53
- Joined
- Jan 4, 2002
- Messages
- 169
Hi Everyone,
I'm stuck again on an ordering system that I'm trying to develop. I'll expalin my situation and hopefully one of you brilliant, wonderful people can help me
I have a combobox, "TheList", that is connected to the query "DueOrders" on my "Order Check" form .
It basically shows any outstanding orders. When i double-click on an item in the list, it takes all the items on the list with the same Supplier and sends the info into a report that is generated and put into an email.
This all works just fine, (Which is a miracle in itself), but now I have one more problem to work out.
For every record that is sent to a report and successfully Emailed, i need it to automatically enter today's date into the "InquerySent?" field that is on the same record. This way, i know if I've already sent an inquery report for each product and when.
I've tried reading my books, but they only have ADO solutions that don't seem to work and I can't find anything specific enough on this forum.
Below is my code if that helps.
Thanks for the help on this, You guys are the best!
-Ben
Private Sub TheList_DblClick(Cancel As Integer)
Dim stWhere As String
Dim stWhere2 As String
Dim Switch As String
Dim Email As String
Dim PO As String
Dim Link As String
Dim cnn As Connection
Dim OnOrder As New ADODB.Recordset
Dim varPosition As Variant
Dim stSQL As String
stSQL = "UPDATE [Dueorders] SET [InquerySent?] = #" & Date & "# Where " & stWhere
PO = Me.TheList.Column(3)
Switch = ChoiceList.Value
Email = HyperlinkPart(Me.TheList.Column(2), acDisplayText)
Link = HyperlinkPart("http://www.microsoft.com/accessdev/articles/snapshot.htm")
Contact = Me.TheList.Column(12)
stWhere = "[Supplier]='" & Me.TheList.Column(1) & "'"
Set DB = Access.CurrentDb
Set rs = DB.OpenRecordset("Dueorders")
Select Case Switch
Case 1
If Not Me.TheList.Column(2) = "" Then
DoCmd.OpenReport "Dueordersreport", acViewPreview, , stWhere
DB.Execute stSQL
DoCmd.SendObject acSendReport, "Dueordersreport", acFormatRTF, Email, , , "PO# " & PO, "Hello, " + vbCr + vbCr & _
"Please review the following attachment as it contains important information from Old Dutch Mustard Co., INC / Pilgrim Foods." + vbCr & _
"If you have any problems opening this file, simply download and install Snapshot Viewer from the following link, directly" + vbCr & _
"from Microsoft's web site." + vbLf + vbLf & _
"http://www.microsoft.com/accessdev/articles/snapshot.htm" + vbCr + vbCr & _
"If you have any questions regarding this E-Mail or it's contents, please contact me via E-Mail, or by the following phone/fax number." + vbCr + vbCr & _
"Sincerely," + vbCr & _
"Ben Bolduc" + vbCr & _
"Pilgrim Foods" + vbCr & _
"Label Room" + vbCr + vbCr & _
"E-Mail: Benbolduc@earthlink.net" + vbCr & _
"Phone#: (603) 878-2100" + vbCr & _
"Fax#: (603) 878-2103"
'
ElseIf Me.TheList.Column(2) = "" And Not IsNull(Me.TheList.Column(13)) Then
Dim Answer As String
Dim Answer2 As String
Answer = MsgBox("An Email address is not currently available for this supplier. Would you like to print this document and fax it?", vbInformation + vbYesNo, "No Email Address")
Select Case Answer
Case vbYes
stWhere = "[Supplier]='" & Me.TheList.Column(1) & "'"
DoCmd.OpenReport "Dueordersreport", acViewPreview, , stWhere
DoCmd.PrintOut acSelection, , , acMedium, 1
Case vbNo
Answer2 = MsgBox("Would you like to print a Contact Info Inquery to fax to this supplier?", vbInformation + vbYesNo, "Send an Information Inquery?")
Select Case Answer2
Case vbYes
DoCmd.OpenReport "Email- Query2", acViewPreview, , "[Company]='" & Me.TheList.Column(1) & "'"
Case vbNo
DoCmd.CancelEvent
End Select
End Select
End If
Case 2
If Not Me.TheList.Column(2) = "" Then
stWhere2 = "[Transaction#]=" & Me.TheList.Column(0)
DoCmd.OpenReport "Dueordersreport", acViewPreview, , stWhere2
DoCmd.SendObject acSendReport, "Dueordersreport", acFormatSNP, Email, , , "PO# " & PO, "Hello, " + vbCr + vbCr & _
"Please review the following attachment as it contains important information from Old Dutch Mustard Co., INC / Pilgrim Foods." + vbCr & _
"If you have any problems opening this file, simply download and install Snapshot Viewer from the following link, directly" + vbCr & _
"from Microsoft's web site." + vbLf + vbLf & _
"http://www.microsoft.com/accessdev/articles/snapshot.htm" + vbCr + vbCr & _
"If you have any questions regarding this E-Mail or it's contents, please contact me via E-Mail, or by the following phone/fax number." + vbCr + vbCr & _
"Sincerely," + vbCr & _
"Ben Bolduc" + vbCr & _
"Pilgrim Foods" + vbCr & _
"Label Room" + vbCr + vbCr & _
"E-Mail: Benbolduc@earthlink.net" + vbCr & _
"Phone#: (603) 878-2100" + vbCr & _
"Fax#: (603) 878-2103"
ElseIf Me.TheList.Column(2) = "" And Not IsNull(Me.TheList.Column(13)) Then
Answer = MsgBox("An Email address is not currently available for this supplier. Would you like to print this document and fax it?", vbInformation + vbYesNo, "No Email Address")
Select Case Answer
Case vbYes
stWhere = "[Supplier]='" & Me.TheList.Column(1) & "'"
DoCmd.OpenReport "Dueordersreport", acViewPreview, , stWhere
DoCmd.PrintOut acSelection, , , acMedium, 1
Case vbNo
Answer2 = MsgBox("Would you like to print a Contact Info Inquery to fax to this supplier?", vbInformation + vbYesNo, "Send an Information Inquery?")
Select Case Answer2
Case vbYes
DoCmd.OpenReport "Email- Query2", acViewPreview, , "[Company]='" & Me.TheList.Column(1) & "'"
Case vbNo
DoCmd.CancelEvent
End Select
End Select
End If
End Select
End Sub
I'm stuck again on an ordering system that I'm trying to develop. I'll expalin my situation and hopefully one of you brilliant, wonderful people can help me
I have a combobox, "TheList", that is connected to the query "DueOrders" on my "Order Check" form .
It basically shows any outstanding orders. When i double-click on an item in the list, it takes all the items on the list with the same Supplier and sends the info into a report that is generated and put into an email.
This all works just fine, (Which is a miracle in itself), but now I have one more problem to work out.
For every record that is sent to a report and successfully Emailed, i need it to automatically enter today's date into the "InquerySent?" field that is on the same record. This way, i know if I've already sent an inquery report for each product and when.
I've tried reading my books, but they only have ADO solutions that don't seem to work and I can't find anything specific enough on this forum.
Below is my code if that helps.
Thanks for the help on this, You guys are the best!
-Ben
Private Sub TheList_DblClick(Cancel As Integer)
Dim stWhere As String
Dim stWhere2 As String
Dim Switch As String
Dim Email As String
Dim PO As String
Dim Link As String
Dim cnn As Connection
Dim OnOrder As New ADODB.Recordset
Dim varPosition As Variant
Dim stSQL As String
stSQL = "UPDATE [Dueorders] SET [InquerySent?] = #" & Date & "# Where " & stWhere
PO = Me.TheList.Column(3)
Switch = ChoiceList.Value
Email = HyperlinkPart(Me.TheList.Column(2), acDisplayText)
Link = HyperlinkPart("http://www.microsoft.com/accessdev/articles/snapshot.htm")
Contact = Me.TheList.Column(12)
stWhere = "[Supplier]='" & Me.TheList.Column(1) & "'"
Set DB = Access.CurrentDb
Set rs = DB.OpenRecordset("Dueorders")
Select Case Switch
Case 1
If Not Me.TheList.Column(2) = "" Then
DoCmd.OpenReport "Dueordersreport", acViewPreview, , stWhere
DB.Execute stSQL
DoCmd.SendObject acSendReport, "Dueordersreport", acFormatRTF, Email, , , "PO# " & PO, "Hello, " + vbCr + vbCr & _
"Please review the following attachment as it contains important information from Old Dutch Mustard Co., INC / Pilgrim Foods." + vbCr & _
"If you have any problems opening this file, simply download and install Snapshot Viewer from the following link, directly" + vbCr & _
"from Microsoft's web site." + vbLf + vbLf & _
"http://www.microsoft.com/accessdev/articles/snapshot.htm" + vbCr + vbCr & _
"If you have any questions regarding this E-Mail or it's contents, please contact me via E-Mail, or by the following phone/fax number." + vbCr + vbCr & _
"Sincerely," + vbCr & _
"Ben Bolduc" + vbCr & _
"Pilgrim Foods" + vbCr & _
"Label Room" + vbCr + vbCr & _
"E-Mail: Benbolduc@earthlink.net" + vbCr & _
"Phone#: (603) 878-2100" + vbCr & _
"Fax#: (603) 878-2103"
'
ElseIf Me.TheList.Column(2) = "" And Not IsNull(Me.TheList.Column(13)) Then
Dim Answer As String
Dim Answer2 As String
Answer = MsgBox("An Email address is not currently available for this supplier. Would you like to print this document and fax it?", vbInformation + vbYesNo, "No Email Address")
Select Case Answer
Case vbYes
stWhere = "[Supplier]='" & Me.TheList.Column(1) & "'"
DoCmd.OpenReport "Dueordersreport", acViewPreview, , stWhere
DoCmd.PrintOut acSelection, , , acMedium, 1
Case vbNo
Answer2 = MsgBox("Would you like to print a Contact Info Inquery to fax to this supplier?", vbInformation + vbYesNo, "Send an Information Inquery?")
Select Case Answer2
Case vbYes
DoCmd.OpenReport "Email- Query2", acViewPreview, , "[Company]='" & Me.TheList.Column(1) & "'"
Case vbNo
DoCmd.CancelEvent
End Select
End Select
End If
Case 2
If Not Me.TheList.Column(2) = "" Then
stWhere2 = "[Transaction#]=" & Me.TheList.Column(0)
DoCmd.OpenReport "Dueordersreport", acViewPreview, , stWhere2
DoCmd.SendObject acSendReport, "Dueordersreport", acFormatSNP, Email, , , "PO# " & PO, "Hello, " + vbCr + vbCr & _
"Please review the following attachment as it contains important information from Old Dutch Mustard Co., INC / Pilgrim Foods." + vbCr & _
"If you have any problems opening this file, simply download and install Snapshot Viewer from the following link, directly" + vbCr & _
"from Microsoft's web site." + vbLf + vbLf & _
"http://www.microsoft.com/accessdev/articles/snapshot.htm" + vbCr + vbCr & _
"If you have any questions regarding this E-Mail or it's contents, please contact me via E-Mail, or by the following phone/fax number." + vbCr + vbCr & _
"Sincerely," + vbCr & _
"Ben Bolduc" + vbCr & _
"Pilgrim Foods" + vbCr & _
"Label Room" + vbCr + vbCr & _
"E-Mail: Benbolduc@earthlink.net" + vbCr & _
"Phone#: (603) 878-2100" + vbCr & _
"Fax#: (603) 878-2103"
ElseIf Me.TheList.Column(2) = "" And Not IsNull(Me.TheList.Column(13)) Then
Answer = MsgBox("An Email address is not currently available for this supplier. Would you like to print this document and fax it?", vbInformation + vbYesNo, "No Email Address")
Select Case Answer
Case vbYes
stWhere = "[Supplier]='" & Me.TheList.Column(1) & "'"
DoCmd.OpenReport "Dueordersreport", acViewPreview, , stWhere
DoCmd.PrintOut acSelection, , , acMedium, 1
Case vbNo
Answer2 = MsgBox("Would you like to print a Contact Info Inquery to fax to this supplier?", vbInformation + vbYesNo, "Send an Information Inquery?")
Select Case Answer2
Case vbYes
DoCmd.OpenReport "Email- Query2", acViewPreview, , "[Company]='" & Me.TheList.Column(1) & "'"
Case vbNo
DoCmd.CancelEvent
End Select
End Select
End If
End Select
End Sub
Last edited: