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

Open Dynaset Problem

Status
Not open for further replies.

jdegeorge

Programmer
Mar 19, 2002
1,313
US
Hi

I have the following code in a form's ON LOAD property
Code:
Dim db As dao.Database, rs As dao.Recordset, sql As String

sql = "SELECT Count(tblGaps.GapID) AS vCount FROM tblGaps "
sql = sql & "WHERE tblGaps.Gap_Status = 1 And tblGaps.Conversion = '" & [Forms]![frmSignOn]![ctlConversion] & "';"

Set db = CurrentDb()
Set rs = db.OpenRecordset(sql, dbOpenDynaset)

For the 2 records that I'm expecting to be selected in this dynaset, tblGaps.Gap_Status does equal 1 and both "tblGaps.Conversion" and "[Forms]![frmSignOn]![ctlConversion]" are text.

I get an error message that the expected value was 1. When I open the code and hold the mouse cursor over "Set rs = db.OpenRecordset(sql, dbOpenDynaset)" the mouseover shows "dbOpenDynaset=2".

What am I doing wrong?

Jim DeGeorge [wavey]
 
Please ignore...I found that changed the value/format of one of those fields which is now throwing me off.

So much for a long weekend! ;-)

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top