Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default SQL Select Where - formatting

Hi Group.
I got good help earlier, so once again I ask for help.
I recorded a macro, where in the query I set DebKart.Sælger = 1
and it worked.
Now I want to get this variable from Sheet2!G13.
But I don't know how to format the SalesPerson value for the SELECT string
to work.

Any help ?
------------------------------------------------------
Dim SalesPerson As Integer
SalesPerson = Range("Sheet2!G13").Value
'
"SELECT DebKart.Konto, DebKart.Navn, DebKart.Sælger" & Chr(13) & ""
& Chr(10) & "FROM DebKart DebKart" & Chr(13) & "" & Chr(10) & "WHERE
(DebKart.Sælger= SalesPerson)" _

--
Med venlig hilsen
Peter Hesselager-Olesen
SBS-IT Aps

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default SQL Select Where - formatting

Peter,
You mean like this ?

"SELECT DebKart.Konto, DebKart.Navn, DebKart.Sælger" & vbNewLine & "FROM
DebKart DebKart" & vbNewLine & "WHERE (DebKart.Sælger=""" & SalePerson &
""")........"

Also, you can use vbNewLine instead.

NickHK

"Peter Hesselager" wrote in
message ...
Hi Group.
I got good help earlier, so once again I ask for help.
I recorded a macro, where in the query I set DebKart.Sælger = 1
and it worked.
Now I want to get this variable from Sheet2!G13.
But I don't know how to format the SalesPerson value for the SELECT string
to work.

Any help ?
------------------------------------------------------
Dim SalesPerson As Integer
SalesPerson = Range("Sheet2!G13").Value
'
"SELECT DebKart.Konto, DebKart.Navn, DebKart.Sælger" & Chr(13) &

""
& Chr(10) & "FROM DebKart DebKart" & Chr(13) & "" & Chr(10) & "WHERE
(DebKart.Sælger= SalesPerson)" _

--
Med venlig hilsen
Peter Hesselager-Olesen
SBS-IT Aps



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting, when select a cell. Saad Excel Discussion (Misc queries) 1 June 1st 09 01:26 PM
Conditional Formatting - Can I select a select with Conditional Formatting? Greegan Excel Worksheet Functions 5 October 31st 05 02:19 PM
can not select conditional formatting gbeard Excel Worksheet Functions 2 April 10th 05 06:15 PM
Select Case Conditional Formatting Sub? RCW Excel Discussion (Misc queries) 2 February 5th 05 10:29 PM
Select Case for Conditional Formatting RonS Excel Programming 3 January 12th 04 05:58 PM


All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"