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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax on Findfirst

Status
Not open for further replies.

Trudye

Programmer
Sep 4, 2001
932
US
Sorry for the double post, I should have posted here instead of the Reports forum.

Hi Everyone, I am having trouble with the syntax on a FindFirst command. Item = integer; itemid = string

rs8.FindFirst "itemid =" & rs3!gItemID & "Item = " & rs3!Item

I know there s/b single quotes, just not sure where to place them.

Thanx much
Trudye
 
Item = integer; itemid = string
rs8.FindFirst "itemid='" & rs3!gItemID & "' And Item=" & rs3!Item

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PHV I finally got that one to work, now I've changed it to a SQL statement and can't get the syntax on that right.

strSQl "Select sum(nz(AmtReceived,0)), sum(nz(Completed, 0)) from dealdetailtracking " _
& "where itemid = '" & rs3!ItemId & "' AND " Item = " & rs3![Item] & "

any ideas?

Thanx
Trudye
 
Get rid of the last & "

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
when I do that I get a syntax error

strSQl "Select sum(nz(AmtReceived,0)), sum(nz(Completed, 0)) from dealdetailtracking " _
& "where itemid = '" & rs3!ItemId & "' AND " Item = " & rs3![Item]

Thanks
Trudye
 
how 'bout
Code:
strSQl[COLOR=red][b] = [/b][/color] "Select sum(nz(AmtReceived,0)), sum(nz(Completed, 0)) from dealdetailtracking " _
   & "where itemid = '" & rs3!ItemId & "' AND Item =  " & rs3![Item]
 
I had to change it because for some reason my FindNext commands stop working. They are sending ALL of my pgms (that have the FindNext command) into a infinite loop. Have you every heard of this before?

So far it has effected 3 programs. here is some sample code:
Tally_Cost_and_Payments:
rs2.FindFirst "dealid = " & rs1!DealID ' rs2 = DealDetail_Hdr table
If rs2.NoMatch Then
GoTo LoopRound
End If

If rs2!Item = "card(s)" Then
HdrAmount = Nz(rs2!Completed, 0) * Nz(rs2!COST, 0)
End If

If rs2!Item = "Appearance" Then
If Nz(rs2!Details_Present, 0) <> -1 Then
' ItemTotal = Nz(rs2!Completed, 0) * Nz(rs2!COST, 0)
HdrAmount = HdrAmount = Nz(rs2!Completed, 0) * Nz(rs2!COST, 0)
Else
GoSub TotalDetail
End If
End If

If rs2!Item = "Memorabilia" Then
GoSub TotalDetail
End If

Do While Not rs2.EOF ' rs2 = DealDetail_Hdr table
rs2.FindNext "dealid = " & rs1!DealID
If rs2.NoMatch Then
'GoSub FinalTally
Return
End If

If rs2!Item = "Card(s)" Then
ItemTotal = Nz(rs2!Completed, 0) * Nz(rs2!COST, 0)
HdrAmount = HdrAmount + ItemTotal
End If

If rs2!Item = "Appearance" Then
If Nz(rs2!Details_Present, 0) <> -1 Then
'ItemTotal
HdrAmount = HdrAmount + (Nz(rs2!Completed, 0) * Nz(rs2!COST, 0))
Else
GoSub TotalDetail
End If
End If

If rs2!Item = "Memorabilia" Then
GoSub TotalDetail
End If

LoopRound:
Loop
Return



Thanx again,
Trudye
 
DUH!!!

I'm working under a very tight deadline and making dumb mistakes.

Thanks for your patience
Trudye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top