add SQL query to report or otherwise enable to produce a report fr

J

JR

I need, somehow, to get a report to run a query or otherwise get a variable
(varied by using a value from either a text box, list box, or combo box)
query:

SELECT Timeslip.EmployeeID, Timeslip.Day, Timeslip.TaskName, Timeslip.Hours,
Timeslip.TaskType, Timeslip.Comments
FROM Timeslip
WHERE (((Timeslip.EmployeeID)="4.0363"));

where the "4.0363" would be equal to the value in either a text box or the
selection from a list or combo box tied to a different table (Employees).

I'd appreciate any suggestions.

Thanks,

JR
 
D

Douglas J. Steele

PARAMETERS Forms![NameOfForm]![NameOfControl] TEXT;
SELECT Timeslip.EmployeeID, Timeslip.Day, Timeslip.TaskName, Timeslip.Hours,
Timeslip.TaskType, Timeslip.Comments
FROM Timeslip
WHERE Timeslip.EmployeeID=Forms![NameOfForm]![NameOfControl]

(replace NameOfForm and NameOfControl with the actual names)

Note that the form must be open for this to work: running the query will not
open the form for you.
 
J

JR

Worked with minor alteration (didn't need fist line).

Thanks.

JR

Douglas J. Steele said:
PARAMETERS Forms![NameOfForm]![NameOfControl] TEXT;
SELECT Timeslip.EmployeeID, Timeslip.Day, Timeslip.TaskName, Timeslip.Hours,
Timeslip.TaskType, Timeslip.Comments
FROM Timeslip
WHERE Timeslip.EmployeeID=Forms![NameOfForm]![NameOfControl]

(replace NameOfForm and NameOfControl with the actual names)

Note that the form must be open for this to work: running the query will not
open the form for you.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


JR said:
I need, somehow, to get a report to run a query or otherwise get a variable
(varied by using a value from either a text box, list box, or combo box)
query:

SELECT Timeslip.EmployeeID, Timeslip.Day, Timeslip.TaskName,
Timeslip.Hours,
Timeslip.TaskType, Timeslip.Comments
FROM Timeslip
WHERE (((Timeslip.EmployeeID)="4.0363"));

where the "4.0363" would be equal to the value in either a text box or the
selection from a list or combo box tied to a different table (Employees).

I'd appreciate any suggestions.

Thanks,

JR


.
 
D

Douglas J. Steele

You may not "need" the first line, but explicitly declaring your parameters
is always a good idea.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


JR said:
Worked with minor alteration (didn't need fist line).

Thanks.

JR

Douglas J. Steele said:
PARAMETERS Forms![NameOfForm]![NameOfControl] TEXT;
SELECT Timeslip.EmployeeID, Timeslip.Day, Timeslip.TaskName,
Timeslip.Hours,
Timeslip.TaskType, Timeslip.Comments
FROM Timeslip
WHERE Timeslip.EmployeeID=Forms![NameOfForm]![NameOfControl]

(replace NameOfForm and NameOfControl with the actual names)

Note that the form must be open for this to work: running the query will
not
open the form for you.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


JR said:
I need, somehow, to get a report to run a query or otherwise get a
variable
(varied by using a value from either a text box, list box, or combo
box)
query:

SELECT Timeslip.EmployeeID, Timeslip.Day, Timeslip.TaskName,
Timeslip.Hours,
Timeslip.TaskType, Timeslip.Comments
FROM Timeslip
WHERE (((Timeslip.EmployeeID)="4.0363"));

where the "4.0363" would be equal to the value in either a text box or
the
selection from a list or combo box tied to a different table
(Employees).

I'd appreciate any suggestions.

Thanks,

JR


.
 
D

deleo

Hello,

I am researching a way to pull Timeslips (by Sage) data into Excel. I
hope my questions relate to this topic. Otherwise sorry.

When I check my available VBA libraries I only find a few select
objects seemingly related to Timeslips by Sage, and none of them seem
to be at all what I need. What I do need out of Timeslips is:
employee hours by type and date (seemingly just what JR is using). It
seems from reading this post that there is a VBA library available
which would allow me to write VBA script in an Excel module and pull
Timeslips data into my workbook. Is this accurate? If so, how do I
obtain the needed libraries and documentation?

What I'd really like is to directly access a Timeslips report. But it
seems from DJS's comment that I would need to manually have Timeslips
run the report first (defeating the automation purpose). Or, can VBA
code tell Timeslips to run the report and then be used to grab the
data from it?

TIA,
WD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top