Microsoft Access Support Forum Index Microsoft Access Support
Discussion and Support for Microsoft Access users
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

Kann ich einer SQL Anweisung ein bestimmtes Feld übergeben

 
Post new topic   Reply to topic    Microsoft Access Support Forum Index -> microsoft.public.de.access
Author Message
Frank Hueppe
Guest





PostPosted: Tue Oct 07, 2008 5:08 am    Post subject: Kann ich einer SQL Anweisung ein bestimmtes Feld übergeben Reply with 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;"

Vielen Dank im voraus

Frank Hüppe
Back to top


Jens Schilling
Guest





PostPosted: Tue Oct 07, 2008 8:40 am    Post subject: Re: Kann ich einer SQL Anweisung ein bestimmtes Feld übergeb Reply with quote

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





PostPosted: Tue Oct 07, 2008 9:59 am    Post subject: Re: Kann ich einer SQL Anweisung e in bestimmtes Feld überge Reply with quote

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





PostPosted: Tue Oct 07, 2008 9:59 am    Post subject: Re: Kann ich einer SQL Anweisung ein bestimmtes Feld übe rge Reply with quote

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


Display posts from previous:   
Post new topic   Reply to topic    Microsoft Access Support Forum Index -> microsoft.public.de.access All times are GMT
Page 1 of 1

 
Jump to:  
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

eXTReMe Tracker