Article View: pl.comp.bazy-danych.msaccess
Article #137171Re: Access 2010 łączenie kilku kryteriów do kwerendy
From: leku
Date: Wed, 04 May 2016 22:24
Date: Wed, 04 May 2016 22:24
45 lines
2705 bytes
2705 bytes
Użytkownik "MaciejF" napisał w wiadomości grup
dyskusyjnych:3dba9a86-1130-4922-812d-2c6c953d8e1f@googlegroups.com...
Witaj,
Zbigniewowi chodziło raczej o użycie zmiennej strId_Kryt w funkcji
Filtruj():
Private Sub Polecenie37_Click()
Call Filtruj("Kryt3")
End Sub
'---------------------------------------------------------
Private Sub Filtruj(strId_kryt As String)
Dim qryTmp As DAO.QueryDef
Dim sWhere As String
sWhere = DLookup("kryt_pow2", "Kryteria_3", "[GU] ='" & strId_kryt & "'")
If IsNull(DLookup("[kryt_pow2]", "Kryteria_3", "[GU] = '" & strId_kryt &
"'")) Then
MsgBox "Brak kryterium = " & strId_kryt
Exit Sub
End If
sWhere = String$(1, 34) & Replace(Trim([sWhere]), Chr(59), String$(1, 34) &
Chr(44) & String$(1, 34)) & String$(1, 34)
sWhere = Replace(sWhere, Chr(32) & Chr(34), Chr(34))
sWhere = Replace(sWhere, Chr(34) & Chr(32), Chr(34))
'Usuń tymczasową kwerendę
On Error Resume Next
DoCmd.DeleteObject acQuery, "qTemp"
If Err.Number <> 0 Then Err.Clear
On Error GoTo 0
Set qryTmp = CurrentDb.CreateQueryDef("qTemp", _
"SELECT Imp_temp.* FROM Imp_temp WHERE F14 IN (" & sWhere & ")")
DoCmd.OpenQuery qryTmp.Name, acViewNormal
End Sub
--------------------------------
A czy ta zmienna strId_Kryt nie powinna być zdefiniowana ?
pozdrawiam
Technical Details
Message-ID:
<572a768a$0$649$65785112@news.neostrada.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mailReferences:
<571b871d$0$641$65785112@news.neostrada.pl> <ng4rbg$b0d$1@node1.news.atman.pl> <57263093$0$22828$65785112@news.neostrada.pl> <ng5idu$n8v$1@node2.news.atman.pl> <57270b34$0$684$65785112@news.neostrada.pl> <3dba9a86-1130-4922-812d-2c6c953d8e1f@googlegroups.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin1!goblin.stu.neva.ru!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail From: "leku" <lekucz@wp.pl> Newsgroups: pl.comp.bazy-danych.msaccess References: <571b871d$0$641$65785112@news.neostrada.pl> <ng4rbg$b0d$1@node1.news.atman.pl> <57263093$0$22828$65785112@news.neostrada.pl> <ng5idu$n8v$1@node2.news.atman.pl> <57270b34$0$684$65785112@news.neostrada.pl> <3dba9a86-1130-4922-812d-2c6c953d8e1f@googlegroups.com> In-Reply-To: <3dba9a86-1130-4922-812d-2c6c953d8e1f@googlegroups.com> Subject: Re: Access 2010 łączenie kilku kryteriów do kwerendy Date: Thu, 5 May 2016 00:24:29 +0200 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 Lines: 47 Message-ID: <572a768a$0$649$65785112@news.neostrada.pl> Organization: Telekomunikacja Polska NNTP-Posting-Host: 83.20.196.104 X-Trace: 1462400651 unt-rea-b-01.news.neostrada.pl 649 83.20.196.104:59106 X-Complaints-To: abuse@news.neostrada.pl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit