Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using InputBox to get desired date for a Query pulling data from Access into Excel


I have a database in Access that contains cycle time data from 6
different stations on an assembly line. I did the record macro while I
did the query and have all the code I need, the only thing I would like
to do is have the macro prompt the user for the desired date to query.
Below is the command taken right from the VB editor.

CommandText = Array( _
"SELECT CYCLE_DATA.STATION_NUMBER, CYCLE_DATA.PART_NUMBER,
CYCLE_DATA.TAKT_TIME, CYCLE_DATA.CYCLE_TIME, CYCLE_DATA.ACTUAL_DATE,
CYCLE_DATA.ACTUAL_TIME" & Chr(13) & "" & Chr(10) & "FROM CYCLE_DATA
CYCLE_DATA" & Chr(13) & "" & Chr(10) & "WHERE (CYCLE_DATA.ACTUAL_DATE=
*'11/3/2004'*)" & Chr(13) & "" & Chr(10) & "ORDER BY
CYCLE_DATA.PART_NUMBER, CYCLE_DATA.STATION_NUMBER,
CYCLE_DATA.ACTUAL_TIME")

I would like to replace the bold 11/3/2004 with a variable that gets
it's value from an Inputbox that the user will type the date into. I
have tried a couple different things but keep getting errors. I am
fairly new to VB programming.

Thanks.

Chad


--
cbeebe
------------------------------------------------------------------------
cbeebe's Profile: http://www.excelforum.com/member.php...o&userid=13601
View this thread: http://www.excelforum.com/showthread...hreadid=275390

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Using InputBox to get desired date for a Query pulling data from Access into Excel


Search for 'parameter query' in Help.

Excel querytables have autoupdate capability so that when you change
a cell (designated as parameter) the Query is autom. refreshed


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


cbeebe wrote :


I have a database in Access that contains cycle time data from 6
different stations on an assembly line. I did the record macro while I
did the query and have all the code I need, the only thing I would like
to do is have the macro prompt the user for the desired date to query.
Below is the command taken right from the VB editor.

CommandText = Array( _
"SELECT CYCLE_DATA.STATION_NUMBER, CYCLE_DATA.PART_NUMBER,
CYCLE_DATA.TAKT_TIME, CYCLE_DATA.CYCLE_TIME, CYCLE_DATA.ACTUAL_DATE,
CYCLE_DATA.ACTUAL_TIME" & Chr(13) & "" & Chr(10) & "FROM CYCLE_DATA
CYCLE_DATA" & Chr(13) & "" & Chr(10) & "WHERE (CYCLE_DATA.ACTUAL_DATE=
*'11/3/2004'*)" & Chr(13) & "" & Chr(10) & "ORDER BY
CYCLE_DATA.PART_NUMBER, CYCLE_DATA.STATION_NUMBER,
CYCLE_DATA.ACTUAL_TIME")

I would like to replace the bold 11/3/2004 with a variable that gets
it's value from an Inputbox that the user will type the date into. I
have tried a couple different things but keep getting errors. I am
fairly new to VB programming.

Thanks.

Chad



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
Web Query Pulling Date Incorrectly. DoveArrow Excel Discussion (Misc queries) 1 August 7th 07 01:21 AM
Excel Data Query from Access Luke Bailey Excel Discussion (Misc queries) 0 February 13th 07 11:24 PM
excel - access query - date range mxp Excel Discussion (Misc queries) 1 January 31st 06 03:44 PM
Pulling Array from InputBox cogent Excel Programming 1 April 27th 04 08:36 AM
Using InputBox to change query criteria in Access JohnBoy Excel Programming 2 September 16th 03 02:08 PM


All times are GMT +1. The time now is 01:53 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"