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

Program flow with sub 1

Status
Not open for further replies.

JDRoss

MIS
Sep 27, 2002
67
IE
I'm trying to have program flow pass to another procedure depending on an if statement result. However, the flow does not go to the other sub, wondering if anybody can help.

Regards

john

the code is as follows:

f rs.RecordCount > 0 Then
rs.FindFirst "Parishonersid = " & meparishonersid & " AND monthid = " & memonth & " AND yearid = " & meyear
'Record does not already exist if you reach the end of the file
If rs.EOF = True Then Monthly_Contribution_Amount_AfterUpdate
 
Hi

To begin with

If you are trying to detect not found, the use Rs.NoMatch

Regards Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Actually, NoMatch is useful w/ DAO, while .EOF is the approach for ADO, so the choice is not so clear cut. Since the snippet of code is SO brief, it is not clear which construct should be used (other than the already-in-use .EOF). The other possability hinted at here is recordcount, but there is certainly insufficient information (code, errors recieved, ... ) to positively identify a correction.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Also, try changing your IF line to:

If rs.EOF = True Then Call Monthly_Contribution_Amount_AfterUpdate

Notice the Call.... Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
rs.Nomatch seemed to solve the problem. Interestingly!

Thanks for all your help once again

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top