runtime error: bad parameter

K

korsakow

Hey,

This is a continuation of question:
http://www.microsoft.com/office/com...cess&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
 
T

Tom van Stiphout

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.

<CLIP>
 
K

korsakow

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top