D
Dimitris Nikolakakis
I have a form named FOrders with fields:
FactoryID (text) and some other fields.
I have a button on the form 'Command88' that in OnClick:
**************************************************************************
Private Sub Command88_Click()
Dim Response
If FactoryID = "KNIPEX" Then
DoCmd.TransferText acExportFixed, "QOrderASCII(KNIPEX)",
"qOrderExportKNIPEX", "c:\order.txt"
Response = MsgBox("bla bla bla bla bla bla", vbOKOnly, "bla bla bla")
If MsgBox("Question", vbYesNo + vbQuestion) = vbNo Then
Cancel = True
Me.ActiveControl.Undo
Else: SendMessage "C:\order.txt"
Me!DateEmailed = Now()
End If
Else
If FactoryID = "IRWIN" Then
DoCmd.OutputTo acOutputQuery, "qOrderExportIRWIN", acFormatXLS,
"c:\order.xls", 0
Response = MsgBox("bla bla bla", vbOKOnly, "bla bla bla")
If MsgBox("Question", vbYesNo + vbQuestion) = vbNo Then
Cancel = True
Me.ActiveControl.Undo
Else: SendMessage "C:\order.xls"
Me!DateEmailed = Now()
End If
End If
End If
End Sub
**************************************************************************
The problem is that:
If the factory is KNIPEX I have no problem........but...
if the factory is IRWIN then if in the question I answer YES (which means
that it sends a mail with SendMessage module) it sends the mail and no other
problem.
If I answer NO then, in a magical way, the query qOrderExportIRWIN is
'damaged'...it only has "SELECT;" and the rest of the code is missing
CODE of QRY is:
****************************
SELECT [OrdersTx].[OrderNo], RTrim([OrdersTx].[StorageItem] &
Space(20-Len([OrdersTx].[StorageItem]))) AS StorageItem,
[OrdersTx].[Quantity]
FROM OrdersTx
WHERE [OrdersTx].[TypeID]="ORD" And
[OrdersTx].[OrderNo]=[Forms]![FOrders]!OrderID
ORDER BY [OrdersTx].[StorageItem];
******************************
Any help is appreciated.....
thanks in advance
Dimitris Nikolakakis
FactoryID (text) and some other fields.
I have a button on the form 'Command88' that in OnClick:
**************************************************************************
Private Sub Command88_Click()
Dim Response
If FactoryID = "KNIPEX" Then
DoCmd.TransferText acExportFixed, "QOrderASCII(KNIPEX)",
"qOrderExportKNIPEX", "c:\order.txt"
Response = MsgBox("bla bla bla bla bla bla", vbOKOnly, "bla bla bla")
If MsgBox("Question", vbYesNo + vbQuestion) = vbNo Then
Cancel = True
Me.ActiveControl.Undo
Else: SendMessage "C:\order.txt"
Me!DateEmailed = Now()
End If
Else
If FactoryID = "IRWIN" Then
DoCmd.OutputTo acOutputQuery, "qOrderExportIRWIN", acFormatXLS,
"c:\order.xls", 0
Response = MsgBox("bla bla bla", vbOKOnly, "bla bla bla")
If MsgBox("Question", vbYesNo + vbQuestion) = vbNo Then
Cancel = True
Me.ActiveControl.Undo
Else: SendMessage "C:\order.xls"
Me!DateEmailed = Now()
End If
End If
End If
End Sub
**************************************************************************
The problem is that:
If the factory is KNIPEX I have no problem........but...
if the factory is IRWIN then if in the question I answer YES (which means
that it sends a mail with SendMessage module) it sends the mail and no other
problem.
If I answer NO then, in a magical way, the query qOrderExportIRWIN is
'damaged'...it only has "SELECT;" and the rest of the code is missing
CODE of QRY is:
****************************
SELECT [OrdersTx].[OrderNo], RTrim([OrdersTx].[StorageItem] &
Space(20-Len([OrdersTx].[StorageItem]))) AS StorageItem,
[OrdersTx].[Quantity]
FROM OrdersTx
WHERE [OrdersTx].[TypeID]="ORD" And
[OrdersTx].[OrderNo]=[Forms]![FOrders]!OrderID
ORDER BY [OrdersTx].[StorageItem];
******************************
Any help is appreciated.....
thanks in advance
Dimitris Nikolakakis