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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

runtime error: bad parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
korsakow - 18 Jan 2008 02:21 GMT
Hey,

This is a continuation of question:
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.access&mid=e8299eae-1918-48c7-9632-843cd65edc0e

This question is about the access runtime error "bad parameter". It gives
thi solution for it: you have to write some VBA to set the RecordSource.
You write this code in "...the appropriate event...". Something like:
Me.RecordSource = "exec dbo.PRO_GEBRUIKER '" &
[forms]![FRM_GEBRUIKER]![txtGetUserName] & "'"

this worked for procedures with one parameter, but i can't fix the bug for
this procedure (see at the bottom)

I tried with:
Private Sub Form_Open(Cancel As Integer)
Me.RecordSource = "exec dbo.filter_werkv_subdossier '" &
[Forms]![FRM_WERKV_SUBDOSSIER_OPZOEKEN1]![tekenaar] & "','" &
[Forms]![FRM_WERKV_SUBDOSSIER_OPZOEKEN1]![projectleider] & "','" &
[Forms]![FRM_WERKV_SUBDOSSIER_OPZOEKEN1]![dossiernummer] & "'"
End Sub

but I get wrong results
can someone help me please?

SELECT      dbo.TBL_BEDRIJF.naam AS klant, dbo.TBL_DOSSIERS.werfnaam AS
werf, dbo.TBL_SUBDOSSIERS.onderdeel,
                       dbo.TBL_SUBDOSSIERS.leverdatum AS termijn,
dbo.TBL_SUBDOSSIERS.start_productie, dbo.TBL_SUBDOSSIERS.start_tekenwerk,
                       dbo.TBL_SUBDOSSIERS.gegevens,
dbo.TBL_SUBDOSSIERS.getekend, dbo.TBL_SUBDOSSIERS.goedgekeurd,
                       dbo.TBL_SUBDOSSIERS.productielijst,
dbo.TBL_SUBDOSSIERS.in_productie, dbo.TBL_SUBDOSSIERS.klaar,
dbo.TBL_SUBDOSSIERS.geleverd,
                       dbo.TBL_SUBDOSSIERS.commentaar,
dbo.TBL_DOSSIERS.dossiers_ID AS dossier
FROM          dbo.TBL_DOSSIERS LEFT OUTER JOIN
                       dbo.TBL_KLANT ON dbo.TBL_DOSSIERS.klantnr =
dbo.TBL_KLANT.klantnummer LEFT OUTER JOIN
                       dbo.TBL_BEDRIJF ON dbo.TBL_KLANT.bedrijf_ID =
dbo.TBL_BEDRIJF.bedrijf_ID LEFT OUTER JOIN
                       dbo.TBL_SUBDOSSIERS ON dbo.TBL_DOSSIERS.dossiers_ID
= dbo.TBL_SUBDOSSIERS.dossiers_ID
WHERE      (dbo.TBL_DOSSIERS.tekenaar_JUMA = @tekenaar) AND
(dbo.TBL_DOSSIERS.projectleider_JUMA = @projectleider) AND
                       (dbo.TBL_DOSSIERS.dossiers_ID = @dossiernummer) AND
(dbo.TBL_SUBDOSSIERS.klaar IS NULL OR
                       dbo.TBL_SUBDOSSIERS.klaar = 0) OR
                       (dbo.TBL_DOSSIERS.projectleider_JUMA =
@projectleider) AND (dbo.TBL_DOSSIERS.dossiers_ID = @dossiernummer) AND
                       (dbo.TBL_SUBDOSSIERS.klaar IS NULL OR
                       dbo.TBL_SUBDOSSIERS.klaar = 0) AND (@tekenaar IS
NULL) OR
                       (dbo.TBL_DOSSIERS.tekenaar_JUMA = @tekenaar) AND
(dbo.TBL_DOSSIERS.projectleider_JUMA = @projectleider) AND
                       (dbo.TBL_SUBDOSSIERS.klaar IS NULL OR
                       dbo.TBL_SUBDOSSIERS.klaar = 0) AND (@dossiernummer
IS NULL) OR
                       (dbo.TBL_DOSSIERS.tekenaar_JUMA = @tekenaar) AND
(dbo.TBL_DOSSIERS.dossiers_ID = @dossiernummer) AND
                       (dbo.TBL_SUBDOSSIERS.klaar IS NULL OR
                       dbo.TBL_SUBDOSSIERS.klaar = 0) AND (@projectleider
IS NULL) OR
                       (dbo.TBL_DOSSIERS.projectleider_JUMA =
@projectleider) AND (dbo.TBL_SUBDOSSIERS.klaar IS NULL OR
                       dbo.TBL_SUBDOSSIERS.klaar = 0) AND (@tekenaar IS
NULL) AND (@dossiernummer IS NULL) OR
                       (dbo.TBL_DOSSIERS.dossiers_ID = @dossiernummer) AND
(dbo.TBL_SUBDOSSIERS.klaar IS NULL OR
                       dbo.TBL_SUBDOSSIERS.klaar = 0) AND (@tekenaar IS
NULL) AND (@projectleider IS NULL) OR
                       (dbo.TBL_DOSSIERS.tekenaar_JUMA = @tekenaar) AND
(dbo.TBL_SUBDOSSIERS.klaar IS NULL OR
                       dbo.TBL_SUBDOSSIERS.klaar = 0) AND (@dossiernummer
IS NULL) AND (@projectleider IS NULL)
ORDER BY dbo.TBL_SUBDOSSIERS.start_tekenwerk, dbo.TBL_DOSSIERS.dossiers_ID,
dbo.TBL_SUBDOSSIERS.subdossiers_ID
Tom van Stiphout - 18 Jan 2008 04:56 GMT
    On Thu, 17 Jan 2008 18:21:00 -0800, korsakow

Korsakow, you're something else.
I'm really trying to be constructive in this newsgroup. I'm not
picking on you. You need to understand how to call Sql Server stored
procedures, and then how to repeat that in Access. I've shown you 95%
of the path. Please take the next step.

NOOOOOO, Not the cliff side   :-)

-Tom.

>Hey,
>
>This is a continuation of question:
>http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.access&mid=e8299eae-1918-48c7-9632-843cd65edc0e
<CLIP>
korsakow - 18 Jan 2008 05:56 GMT
I'm really saerching for it, books, google,... I can't fin info for it.
I know you did already a lot for me, maybe you can send me a link of a good
site?

>     On Thu, 17 Jan 2008 18:21:00 -0800, korsakow
>
[quoted text clipped - 13 lines]
> >http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.access&mid=e8299eae-1918-48c7-9632-843cd65edc0e

> <CLIP>
 
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



©2009 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.