Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Required

Status
Not open for further replies.

jossimon

Programmer
Feb 4, 2005
39
US
I have the following code and I am getting an error that says "Object Required." The debugger is highlighting the line "If NZ(TorderImpFilter.Shippable, 0) > 0 Then"
What am I doing wrong?

Private Sub Crt_ExportFile_Click()
Dim i As Integer
Dim StrSQL As String

If Nz(TOrderImpFilter.Shippable, 0) > 0 Then

For i = 1 To TOrderImpFilter.Shippable
StrSQL = "Insert into TExportFile (SITM,CustomerOrderNumber) VALUES TOrderImpFilter.SITM, TOrderImpFilter.CustomerOrderNumber from TOrderImpFilter;"
DoCmd.RunSQL StrSQL
Next i

Else
MsgBox "Shippable must be greater than 1."
End If

End Sub
 
TOrderImpFilter is a table, so take a look at the DLookUp function:
If Nz(DLookUp("Shippable", "TOrderImpFilter"), 0) > 0 Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I am now getting an error stating Syntax error in Insert Into statement.
 
Can you post your amended code ?
Anyway, replace VALUES by SELECT

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top