Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2007

Tip: Looking for answers? Try searching our database.

Error: 3601

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stalin - 30 May 2007 01:01 GMT
I have the following code looking up a record count, I am receiving
the 3601 error code on open.
Can anyone see what I might be doing wrong with this?  I have enclosed
all parameters in brackets.

Another pair of eyes is requested.

Thanks in advance -
/***********
Private Sub Form_LOAD()
Dim db As Database
Dim rs As Recordset
Dim strSql As String
Dim p1 As String
Dim p2 As String
p1 = [Forms]![tabbed]![EMP2].Form![DEPT_CODE]
p2 = [Forms]![tabbed]![EMP2].Form![EMP_ID]

strSql = "SELECT * FROM SOP WHERE SOP.STATUS = ""ACTIVE"" AND SOP." &
p1 & "  = True AND SOP.SOP_ID Not In (SELECT SOP_ID FROM EMP_SOP WHERE
EMP_SOP.EMP_ID = " & p2 & ")"

Set db = CurrentDb()
Set rs = db.OpenRecordset(strSql)

End Sub
***********/
Dirk Goldgar - 30 May 2007 03:57 GMT
> I have the following code looking up a record count, I am receiving
> the 3601 error code on open.
[quoted text clipped - 23 lines]
> End Sub
> ***********/

Do you mean error 3061, by any chance?  That's "Too few parameters".  I
don't know of any error 3601, so I'm going to guess you mean 3061.  If
I'm right, then examine the value of strSql before you open the
recordset.  Make sure that all of the field names are correctly spelled
and actually exist in the tables where your SQL thinks they are.  Also
make sure that all text literals are enclosed in quotes.  For example,
if SOP.EMP_ID is a text value, then you need to surround the embedded
value of p2 with quotes.  Otherwise the database engine is going to
think it's a parameter, as it will for any name it doesn't recognize.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Stalin - 30 May 2007 04:27 GMT
On May 29, 9:57 pm, "Dirk Goldgar" <d...@NOdataSPAMgnostics.com>
wrote:
> Innews:1180483273.546747.67660@q66g2000hsg.googlegroups.com,
>
[quoted text clipped - 40 lines]
>
> (please reply to the newsgroup)

Little bit of dyslexia there, I did mean error 3061.
Thanks for the second pair of eyes on it, I should have noticed the
quotes missing myself.

Also thanks for the quick response to my post.

Best Regards,

Stalin
Stalin - 30 May 2007 05:03 GMT
> On May 29, 9:57 pm, "Dirk Goldgar" <d...@NOdataSPAMgnostics.com>
> wrote:
[quoted text clipped - 53 lines]
>
> Stalin

Sorry bad form, here is the corrected code, thanks again for all you
help.

strSql = "SELECT * FROM SOP WHERE SOP.STATUS = ""ACTIVE"" AND SOP." &
p1 & " = True AND SOP.SOP_ID Not In (SELECT SOP_ID FROM EMP_SOP WHERE
EMP_SOP.EMP_ID = """ & p2 & """)"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.