473,396 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Converting data from a column into vba script to print repots

Hello,

My issue is that I have a form and report that are required to be printed out daily and each sheet must presently be selected by the individual record to have the forms print because they use a SQL SELECT TOP 40 to generate the data set based on the employee's number.

That SQL statement is :
strSQL = "SELECT TOP 40 [Job Table].[KMA Job #], [Job Table].[Job Completion Notes], [Job Table].[Asg Unit], Right([kma job #],1) AS Event, Left([kma job #],2) AS Stuff, Left([Job Description],3) AS estTrk FROM [Job Table] INNER JOIN Customer ON [Job Table].Customer = Customer.Customer WHERE (((Customer.Type) = 'Residential')) GROUP BY [Job Table].[KMA Job #], [Job Table].[Asg Unit], Right([kma job #],1), Left([kma job #],2), Left([Job Description],3), [Job Table].[Job Completion Notes] HAVING ((([Job Table].[Asg Unit])=" & stData & ") AND ((Left([Job Description],3))='est')) ORDER BY [Job Table].[KMA Job #] DESC;"

where stData is equal to the unit number of the employee which is selected from a combobox on the form. The selects the last 40 jobs for an employee.

The query (qryTechNumber) that I want to pull the data from looks like:

Unit
20
25
28
32

My employer wants to push a single button and have all of the forms/reports print out in sequence. The employee's change frequently so I need to build the form in such a way that I don't have to modify the underlying code to make it work.

What I need is a method that will take the data from that query at place it into the stData field and print the form. I can handle the SQL and the looping equation, but what I cannot figure out is how to get the data from the query and place it into a method that I can place into the stData field.

Because I am using "SELECT TOP" in my SQL statement I cannot simply make a big master report with all the employees and I need to generate it on a per employee basis.
Dec 20 '10 #1
1 1405
orangeCat
83 64KB
TOP 40 what?
You really print out Forms, or do you print out Reports?
You say you use SQL to generate the Form? I think you use SQL to select the data required to satisfy the request, then use a Form or Report to Format the data into the proper format.

I think you should review the requirement; write down exactly what is needed; then start to translate that into Access queries/forms/reports etc; do some testing and even Create a separate form with a Button so whoever wants to push the button and have all the reports can do so.
Dec 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: jaYPee | last post by:
I have created a stored procedure that contain this field (below) in order to meet certain criteria. But my problem is when I try to run the stored procedure I encounter an error "Error converting...
4
by: alederer | last post by:
Hallo! I need to convert the values of a varchar (..) for bit data column to a string which can be stored in a normal varchar column (with additional information). Is there a function in db2...
1
by: luna | last post by:
got so far then it broke and i cant get it working again - it was updating fine but not inserting and now im getting a "Error converting data type varchar to numeric" which i didnt have before.......
0
by: rajmgopal | last post by:
Hello Everyone I am getting the following error when i try to insert a record into Sql Server 2005 from my VB 2005 application. sqlEx = {"Error converting data type numeric to numeric."} I...
1
by: neeraj | last post by:
Hi All Can any give me the code for convert "DataColumn" data type of "DataTable". Even if data table already populated (have data) Actually I am creating one search module which searches the...
0
by: Adele | last post by:
Please help, I'm new to SQL and I use a script to import data and when I tried importing data tonight it gave me "error converting data type nvarchar to float". I have no idea what this error...
1
by: voroojak | last post by:
HI i have a very big problem. i have a cloumn name Revenue and i have differt types of revenue in it such as A, B, C. what i want to do is that i want to say that when the Revenue column is A...
0
Krishna Ladwa
by: Krishna Ladwa | last post by:
In Sql Server 2000 Version, I found that no Notification message box appears when converting text column to varchar but the data gets truncated to the given size for the varchar. Whereas it appears...
0
by: bluepiper | last post by:
Hi everyone. I have created a linked server on SQL Server 2005 to access data from visual foxpro database. I execute a query Select * from OpenQuery(members, 'Select * from memfile') but Im...
5
AAPWM
by: AAPWM | last post by:
Hello My job is to extract data from my companies database with Crystal Reports, export that data to Excel, modify the data, save the data as "Text "tab delimited"", and upload to the database...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.