 |
Microsoft Access Support
Discussion and Support for Microsoft Access users |
|
|
| Author |
Message |
Frank Hueppe Guest
|
Posted: Tue Oct 07, 2008 5:08 am Post subject: Kann ich einer SQL Anweisung ein bestimmtes Feld übergeben |
|
|
Hallo an die NG,
ich ahbe das Problem, dass ich in einer SQL Anweisung ein Parameter in Form
eines Feldbezugs aus einem Listenfeld übergeben will.
Bei der Eigenschaft Feld.Colunn(1) erkennt mir Access die Klammern nicht.
Hier der komplette Ausdruck:
Me.Kombinationsfeld117.RowSource = "SELECT [SAP-Gebäudedatei].ID,
[SAP-Gebäudedatei].WE, [SAP-Gebäudedatei].VB, [SAP-Gebäudedatei].PLZ,
[SAP-Gebäudedatei].Ort, [SAP-Gebäudedatei].Strasse,
[SAP-Gebäudedatei].Hausnummer FROM [SAP-Gebäudedatei] WHERE
((([SAP-Gebäudedatei].VB) =
Formulare![Frm_Gebaeudekartei]!Kombinationsfeld23.column(1)));" ORDER BY
[SAP-Gebäudedatei].WE, [SAP-Gebäudedatei].Strasse,
[SAP-Gebäudedatei].Hausnummer;"
Vielen Dank im voraus
Frank Hüppe |
|
| Back to top |
|
 |
|
Jens Schilling Guest
|
Posted: Tue Oct 07, 2008 8:40 am Post subject: Re: Kann ich einer SQL Anweisung ein bestimmtes Feld übergeb |
|
|
Hallo, Frank
Frank Hueppe wrote:
| Quote: |
Hallo an die NG,
ich ahbe das Problem, dass ich in einer SQL Anweisung ein Parameter
in Form eines Feldbezugs aus einem Listenfeld übergeben will.
Bei der Eigenschaft Feld.Colunn(1) erkennt mir Access die Klammern
nicht.
|
Probier's mal mit Eval() :
Eval(Formulare![Frm_Gebaeudekartei]!Kombinationsfeld23.column(1))
--
Gruss
Jens
______________________________
11. AEK - Oktober 2008 ( www.donkarl.com/?AEK )
FAQ: http://www.donkarl.com |
|
| Back to top |
|
 |
|
Thomas Winkler Guest
|
Posted: Tue Oct 07, 2008 9:59 am Post subject: Re: Kann ich einer SQL Anweisung e in bestimmtes Feld überge |
|
|
Hi,
| Quote: |
Me.Kombinationsfeld117.RowSource = "SELECT [SAP-Gebäudedatei].ID,
[SAP-Gebäudedatei].WE, [SAP-Gebäudedatei].VB, [SAP-Gebäudedatei].PLZ,
[SAP-Gebäudedatei].Ort, [SAP-Gebäudedatei].Strasse,
[SAP-Gebäudedatei].Hausnummer FROM [SAP-Gebäudedatei] WHERE
((([SAP-Gebäudedatei].VB) =
Formulare![Frm_Gebaeudekartei]!Kombinationsfeld23.column(1)));" ORDER BY
|
was soll das Semikolon und das " dort? Ist hoffentlich ein C&P-Fehler.
BTW: Gib Deinen Controls sprechende Namen evtl. i.V.m. der ungarischen
Notation.
HTH
Thomas
--
"Access? Damit arbeite ich nicht. Das ist doch nur ein abgespecktes Excel." |
|
| Back to top |
|
 |
Karl Donaubauer Guest
|
Posted: Tue Oct 07, 2008 9:59 am Post subject: Re: Kann ich einer SQL Anweisung ein bestimmtes Feld übe rge |
|
|
Frank Hueppe wrote:
| Quote: |
Hallo an die NG,
ich ahbe das Problem, dass ich in einer SQL Anweisung ein Parameter in
Form eines Feldbezugs aus einem Listenfeld übergeben will.
Bei der Eigenschaft Feld.Colunn(1) erkennt mir Access die Klammern nicht.
Hier der komplette Ausdruck:
Me.Kombinationsfeld117.RowSource = "SELECT [SAP-Gebäudedatei].ID,
[SAP-Gebäudedatei].WE, [SAP-Gebäudedatei].VB, [SAP-Gebäudedatei].PLZ,
[SAP-Gebäudedatei].Ort, [SAP-Gebäudedatei].Strasse,
[SAP-Gebäudedatei].Hausnummer FROM [SAP-Gebäudedatei] WHERE
((([SAP-Gebäudedatei].VB) =
Formulare![Frm_Gebaeudekartei]!Kombinationsfeld23.column(1)));" ORDER BY
[SAP-Gebäudedatei].WE, [SAP-Gebäudedatei].Strasse,
[SAP-Gebäudedatei].Hausnummer;"
|
Kommt drauf an, welchen Datentyp "VB" hat. Wenn es Text ist, dann:
Me!Kombinationsfeld117.RowSource = _
"SELECT ID, WE, VB, PLZ, Ort, Strasse, Hausnummer" &
" FROM [SAP-Gebäudedatei]" & _
" WHERE VB = '" & Forms!Frm_Gebaeudekartei!Kombinationsfeld23.column(1) &
"'" & _
" ORDER BY WE, Strasse, Hausnummer"
Ersetze "Kombinationsfeld117" und "Kombinationsfeld23"
durch aussagekräftigere Namen. Wenn möglich, dann entferne auch
den Bindestrich in [SAP-Gebäudedatei]. Das erspart die Klammern.
s.a. www.donkarl.com?FAQ1.5
--
HTH
Karl
********* Ich beantworte keine Access-Fragen per Email. *********
Access-FAQ: http://www.donkarl.com, jetzt mit Anmeldung und Info
zur Access-Entwickler-Konferenz (AEK11), Oktober 2008, Nürnberg |
|
| Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|