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