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

How would you determine if a split form contains 0 records 1

Status
Not open for further replies.

Pack10

Programmer
Feb 3, 2010
495
US
I have a split form that might not contain any records. I test to see if the form is open, and if it is open I have an SQL statement that gets assigned to a recordset object.
If the sql returns 0 records, i get error 2427 "you entered an expression that has no value".
I need to test the value before the sql runs...any ideas.
 
It's a simple if statement, if the form is open but contains no records the sSQL causes error 2427

If IsOpen("Manager Queue") Then
sSQL = "SELECT Assigned_DDQs.* FROM Assigned_DDQs WHERE Parent = " & Forms![Manager queue]! [Parent]
End If

 
The forms![manager queue]!Parent contains no value. But it causes the 2427 error
 
Is that your actual code? Did you copy and paste? It looks like there is a space after the !.

Is Parent the name of a control on the form? Do you know that Parent is a reserved word?

Does the form return no records in its recordsource? Is that what is causing the issue?

Duane
Hook'D on Access
MS Access MVP
 
That's the actual code. I copied and pasted it. There is no space after the !
Parent is the name of a field on the split form (Manager Queue).
I did not know it was a reserved word. I will deal with that.
Its just that I cant trap the error because if I test the value of Forms![Manager queue]![Parent]

I get the 2427 error.
 
That did it!!!!!!!!! Great thanks, Thats the way to end a week. Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top