Never Hide
Registered User.
- Local time
- Today, 22:15
- Joined
- Dec 22, 2011
- Messages
- 96
Hi guys,
I'm trying to open a recordset in vba and I'm getting the 3061 runtime error,Expected 1.
After some searching I found out that the problem is that I'm trying to open a recordset with a query that uses a referance to a form control.
Could someone please explain to me how I should go about it to correct that problem?
This is the sql of the query:
The highlighted parted is the form referance ( I know it's obvious, just for easier spotting
)
also as you can see it's a datepicker control, so the value is a date
I'm trying to open a recordset in vba and I'm getting the 3061 runtime error,Expected 1.
After some searching I found out that the problem is that I'm trying to open a recordset with a query that uses a referance to a form control.
Could someone please explain to me how I should go about it to correct that problem?
Code:
searchtable1 = "qInVisio_RSV"
Set rs = db.OpenRecordset(searchtable1, dbOpenDynaset, dbSeeChanges)
This is the sql of the query:
The highlighted parted is the form referance ( I know it's obvious, just for easier spotting
Code:
SELECT dbo_FOLIO.FOLIOID, dbo_FOLIO.KIND, dbo_FOLIO.RSVID, dbo_FOLIO.CHKIDATE, dbo_RLIST.ROOMID, dbo_ROOM.ROOMNO, dbo_AGN.LINAPRG
FROM (dbo_ROOM INNER JOIN (dbo_FOLIO INNER JOIN dbo_RLIST ON dbo_FOLIO.RSVID = dbo_RLIST.RSVID) ON dbo_ROOM.ROOMID = dbo_RLIST.ROOMID) LEFT JOIN dbo_AGN ON dbo_FOLIO.AGNID = dbo_AGN.AGNID
WHERE (((dbo_FOLIO.KIND)=101) AND ((dbo_FOLIO.CHKIDATE)>=[COLOR="Red"][Forms]![frmCleaningPlan]![DTPicker][/COLOR]));
also as you can see it's a datepicker control, so the value is a date