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

Sorry for all the posts, but time i

Status
Not open for further replies.

mdmarney

IS-IT--Management
Jan 16, 2003
68
US
Sorry for all the posts, but time is running out!

Related Code:
Set rs2 = CurrentDb.OpenRecordset("Select * from tbl_Attendants Where Arrival_Verification = TRUE AND Parish_Group_ID = " & Forms!frm_Check_In_Attendants_by_Group!frm_Check_In_Attendants_by_Group_Subform.Form![Parish_Group_ID])

Error: No current record
On: rs2.MoveLast

There ARE records. What am I doing wrong??? *************
M. MARNEY
 
Try this
Dim strSQL as String
strSQL = "Select * from tbl_Attendants Where Arrival_Verification = TRUE AND Parish_Group_ID = " & Forms!frm_Check_In_Attendants_by_Group!frm_Check_In_Attendants_by_Group_Subform.Form![Parish_Group_ID]
Debug.Print strSQL
Set rs2 = CurrentDb.OpenRecordset(strSQL)
Make sure the Debug window is showing and run the code. The string will print to the debug window. Copy and paste whatever is written to the debug window to this post so we can look at it.

Paul
 
Did what you said. (Assume you meant immediate window as I do not have a debug window.)

Results:
Select * from tbl_Attendants Where Arrival_Verification = TRUE AND Parish_Group_ID = -1667318470
Select * from tbl_Attendants Where Arrival_Verification = TRUE AND Parish_Group_ID = 1426404853
Select * from tbl_Attendants Where Arrival_Verification = TRUE AND Parish_Group_ID = 1043363797
Select * from tbl_Attendants Where Arrival_Verification = TRUE AND Parish_Group_ID = -771598

No errors.

When I added the rs2.Movelast back into the code it errored out again. *************
M. MARNEY
 
Immediate and Debug are the same. So the values for Group_ID are correct. Sorry but they seem a little unusual for a Group_ID. What datatype are they in the table. The syntax shows them as numeric values. What happens if you take out the second half of the Where clause. Do you get records. What happens if you just use the second half of the Where clause. Does it still error out.
This shouldn't be the problem but what if you add
rs2.MoveFirst
before the rs2.MoveLast.

Paul
 
Works fine when the two statements are used separately; see exhibit A below.
rs2.movefirst caused the same error, but on the movfirst statement.
I also tried switching the two around (see exhibit b) and that yielded a No current record error as well.
Thoughts?


Exhibit A:
Select * from tbl_Attendants Where Arrival_Verification = TRUE
Select * from tbl_Attendants Where Arrival_Verification = TRUE
Select * from tbl_Attendants Where Parish_Group_ID = 747517777
Select * from tbl_Attendants Where Parish_Group_ID = -1076423024

Exhibit B:
Select * from tbl_Attendants Where Parish_Group_ID = 1044031768 AND Arrival_Verification = TRUE *************
M. MARNEY
 
Here's a shot in the dark. You have a statement at the top of your module Option Compare Database. You say that the values for Group_ID are Binary, change your option compare statement to
Option Compare Binary

see if that makes a difference.

Paul
 
No, Group_ID is the really wierd number (Random). It is what links tbl_people (many) to tbl_Groups (one). The bonary value is from our other thread and is the value of Parish_Group_Arrival. What I have been posting in this thread is a separate problem. *************
M. MARNEY
 
OK, it was a long shot. So you say it works fine when the two are used separately. That means you get records back when you rs2.MoveLast? Ok here's another shot with my eyes closed. Change True to -1 in your select statement.

Paul
 
Sorry, Nope. I think I will start a new thread on this specific problem, but if you have any more ideas, you can post here. I appreciate your sticking with it! *************
M. MARNEY
 
Sorry. I don't see anything that points to a problem, especially if you return records when splitting the statement in halves.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top