C
cbeebe
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
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