J
jbair via AccessMonster.com
I'm learning here this is something I don't have to do just want to know how
to do it any help would be appreciated.
I want to learn how to use the * I heve the following code that works great
Function AppendandCancelOrder()
SoNum = InputBox("Enter Sales Order you would like to cancel")
If Len(SoNum) > 0 Then
sqlstr = "INSERT INTO CancelandRestockTable ( SalesOrder, StartDate,
Quantity, NCParts, PullDate, PartsPullID1, NCAssy, PartsPullID2, Test3Date,
Test2M1, Test2G1, Test2ICBox, NCLine3, TestID3, NCInspection, InspectionDate,
InspectorID1, InspectorID2, NCShipping, PackDate, PackerID, SpecialHandling,
Shortage, InspectedRpm, InspectedAmps, AssyLineNumberInspection, [Quantity NC]
, NCNotes, PreAssemblyID, PreAssemblyDate, PartsPullLocation, OrderDueDate,
PartsOutLocation, Nomenclature, PaintType, Minutes, PreAssemblyComplete,
BrTorque, Ratio, FlangeSize, Shaft, BrVoltage, Mount, Stator )" & _
"SELECT InspectionLog.SalesOrder, InspectionLog.StartDate, InspectionLog.
Quantity, InspectionLog.NCParts, InspectionLog.PullDate, InspectionLog.
PartsPullID1, InspectionLog.NCAssy, InspectionLog.PartsPullID2, InspectionLog.
Test3Date, InspectionLog.Test2M1, InspectionLog.Test2G1, InspectionLog.
Test2ICBox, InspectionLog.NCLine3, InspectionLog.TestID3, InspectionLog.
NCInspection, InspectionLog.InspectionDate, InspectionLog.InspectorID1,
InspectionLog.InspectorID2, InspectionLog.NCShipping, InspectionLog.PackDate,
InspectionLog.PackerID, InspectionLog.SpecialHandling, InspectionLog.Shortage,
InspectionLog.InspectedRpm, InspectionLog.InspectedAmps, InspectionLog.
AssyLineNumberInspection, InspectionLog.[Quantity NC], InspectionLog.NCNotes,
InspectionLog.PreAssemblyID, InspectionLog.PreAssemblyDate, InspectionLog.
PartsPullLocation, InspectionLog.OrderDueDate, InspectionLog.PartsOutLocation,
InspectionLog.Nomenclature, InspectionLog.PaintType, InspectionLog.Minutes,
InspectionLog.PreAssemblyComplete," & _
"InspectionLog.BrTorque, InspectionLog.Ratio, InspectionLog.FlangeSize,
InspectionLog.Shaft, InspectionLog.BrVoltage, InspectionLog.Mount,
InspectionLog.Stator FROM InspectionLog WHERE (((InspectionLog.SalesOrder)='"
& SoNum & "'));"
DoCmd.RunSQL sqlstr
If MsgBox("Are you sure you want to cancel all data associated with this
order?", vbYesNo) = vbYes Then
sqlstr = "DELETE InspectionLog.SalesOrder FROM InspectionLog WHERE ((
(InspectionLog.SalesOrder)='" & SoNum & "'));"
DoCmd.RunSQL sqlstr
ElseIf vbNo Then
Exit Function
End If
End If
End Function
I want to use the * and am hving trouble with calling the INSERT INTO like
this
Function AppendandCancelOrder1()
SoNum = InputBox("Enter Sales Order you would like to cancel")
If Len(SoNum) > 0 Then
sqlstr = "INSERT INTO CancelandRestockTable(*) " & _
"SELECT InspectionLog.* FROM InspectionLog WHERE (((InspectionLog.
SalesOrder)='" & SoNum & "'));"
DoCmd.RunSQL sqlstr
If MsgBox("Are you sure you want to cancel all data associated with this
order?", vbYesNo) = vbYes Then
sqlstr = "DELETE InspectionLog.SalesOrder FROM InspectionLog WHERE ((
(InspectionLog.SalesOrder)='" & SoNum & "'));"
DoCmd.RunSQL sqlstr
ElseIf vbNo Then
Exit Function
End If
End If
End Function
Thanks
Jerry
to do it any help would be appreciated.
I want to learn how to use the * I heve the following code that works great
Function AppendandCancelOrder()
SoNum = InputBox("Enter Sales Order you would like to cancel")
If Len(SoNum) > 0 Then
sqlstr = "INSERT INTO CancelandRestockTable ( SalesOrder, StartDate,
Quantity, NCParts, PullDate, PartsPullID1, NCAssy, PartsPullID2, Test3Date,
Test2M1, Test2G1, Test2ICBox, NCLine3, TestID3, NCInspection, InspectionDate,
InspectorID1, InspectorID2, NCShipping, PackDate, PackerID, SpecialHandling,
Shortage, InspectedRpm, InspectedAmps, AssyLineNumberInspection, [Quantity NC]
, NCNotes, PreAssemblyID, PreAssemblyDate, PartsPullLocation, OrderDueDate,
PartsOutLocation, Nomenclature, PaintType, Minutes, PreAssemblyComplete,
BrTorque, Ratio, FlangeSize, Shaft, BrVoltage, Mount, Stator )" & _
"SELECT InspectionLog.SalesOrder, InspectionLog.StartDate, InspectionLog.
Quantity, InspectionLog.NCParts, InspectionLog.PullDate, InspectionLog.
PartsPullID1, InspectionLog.NCAssy, InspectionLog.PartsPullID2, InspectionLog.
Test3Date, InspectionLog.Test2M1, InspectionLog.Test2G1, InspectionLog.
Test2ICBox, InspectionLog.NCLine3, InspectionLog.TestID3, InspectionLog.
NCInspection, InspectionLog.InspectionDate, InspectionLog.InspectorID1,
InspectionLog.InspectorID2, InspectionLog.NCShipping, InspectionLog.PackDate,
InspectionLog.PackerID, InspectionLog.SpecialHandling, InspectionLog.Shortage,
InspectionLog.InspectedRpm, InspectionLog.InspectedAmps, InspectionLog.
AssyLineNumberInspection, InspectionLog.[Quantity NC], InspectionLog.NCNotes,
InspectionLog.PreAssemblyID, InspectionLog.PreAssemblyDate, InspectionLog.
PartsPullLocation, InspectionLog.OrderDueDate, InspectionLog.PartsOutLocation,
InspectionLog.Nomenclature, InspectionLog.PaintType, InspectionLog.Minutes,
InspectionLog.PreAssemblyComplete," & _
"InspectionLog.BrTorque, InspectionLog.Ratio, InspectionLog.FlangeSize,
InspectionLog.Shaft, InspectionLog.BrVoltage, InspectionLog.Mount,
InspectionLog.Stator FROM InspectionLog WHERE (((InspectionLog.SalesOrder)='"
& SoNum & "'));"
DoCmd.RunSQL sqlstr
If MsgBox("Are you sure you want to cancel all data associated with this
order?", vbYesNo) = vbYes Then
sqlstr = "DELETE InspectionLog.SalesOrder FROM InspectionLog WHERE ((
(InspectionLog.SalesOrder)='" & SoNum & "'));"
DoCmd.RunSQL sqlstr
ElseIf vbNo Then
Exit Function
End If
End If
End Function
I want to use the * and am hving trouble with calling the INSERT INTO like
this
Function AppendandCancelOrder1()
SoNum = InputBox("Enter Sales Order you would like to cancel")
If Len(SoNum) > 0 Then
sqlstr = "INSERT INTO CancelandRestockTable(*) " & _
"SELECT InspectionLog.* FROM InspectionLog WHERE (((InspectionLog.
SalesOrder)='" & SoNum & "'));"
DoCmd.RunSQL sqlstr
If MsgBox("Are you sure you want to cancel all data associated with this
order?", vbYesNo) = vbYes Then
sqlstr = "DELETE InspectionLog.SalesOrder FROM InspectionLog WHERE ((
(InspectionLog.SalesOrder)='" & SoNum & "'));"
DoCmd.RunSQL sqlstr
ElseIf vbNo Then
Exit Function
End If
End If
End Function
Thanks
Jerry