473,395 Members | 1,578 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,395 software developers and data experts.

DataReport

89
Hi all, I am using VBA with autoCAD interface, I have included database. However in BVA has no datareport, So how to I include datareport with VBA, Thx advance.
Jan 3 '08 #1
9 1889
puppydogbuddy
1,923 Expert 1GB
Hi all, I am using VBA with autoCAD interface, I have included database. However in BVA has no datareport, So how to I include datareport with VBA, Thx advance.
To output a report in VBA, you can (among other things):
output as an Access report created report designer
____________________________________________

DoCmd.OpenReport "yourReport", acViewPreview

or output and save as a Word rtf:
__________________________
DoCmd.OutputTo acOutputReport, strReportName, "c:\Temp\" & strReportName & ".rtf", False
Jan 3 '08 #2
shaiful
89
To output a report in VBA, you can (among other things):
output as an Access report created report designer
____________________________________________

DoCmd.OpenReport "yourReport", acViewPreview

or output and save as a Word rtf:
__________________________
DoCmd.OutputTo acOutputReport, strReportName, "c:\Temp\" & strReportName & ".rtf", False
Hi I make a report by using access and call it in vba code : DoCmd.OpenReport "yourReport", acViewPreview

one time it was run and i saw report but after that ...............
its say Run-Time error '2486"
You can't carry out this action at the present time

also want to if i send some query from from and add where condition in that case how report will be i mean query data i need to send from "from end"
Thx again
Jan 4 '08 #3
puppydogbuddy
1,923 Expert 1GB
Hi I make a report by using access and call it in vba code : DoCmd.OpenReport "yourReport", acViewPreview

one time it was run and i saw report but after that ...............
its say Run-Time error '2486"
You can't carry out this action at the present time

also want to if i send some query from from and add where condition in that case how report will be i mean query data i need to send from "from end"
Thx again
Hi shaiful,
My reference to "YourReport" was just to give you an example. You need to replace "YourReport" with the actual name of your report.

Not sure what you mean about sending query data "from end". If you are refering to front-end vs back-end, queries generally are in the front-end. The exception is a query known as a stored procedure, which is designed for server execution and therefore, resides with the server in the back-end.
Jan 5 '08 #4
shaiful
89
Hi shaiful,
My reference to "YourReport" was just to give you an example. You need to replace "YourReport" with the actual name of your report.

Not sure what you mean about sending query data "from end". If you are refering to front-end vs back-end, queries generally are in the front-end. The exception is a query known as a stored procedure, which is designed for server execution and therefore, resides with the server in the back-end.
Hi fisrt thx a lot 4 ur reply, I progress a lot on my project, however i stack only ---
I have a variavle such as dim Id as integer
and i want to send ot to database table for query condition where query will be select * from student where S_ID=" & ID & ",

But i dont know how to i send variables to the DB? Thx again
Jan 7 '08 #5
puppydogbuddy
1,923 Expert 1GB
Hi fisrt thx a lot 4 ur reply, I progress a lot on my project, however i stack only ---
I have a variavle such as dim Id as integer
and i want to send ot to database table for query condition where query will be select * from student where S_ID=" & ID & ",

But i dont know how to i send variables to the DB? Thx again
Still not sure what you want, but easiest way to update a table is to turn your select query into an update query, by changing the query type via the query button on the Access command menu, and executing it accordingly.

By the way your syntax on the select query is incorrect. It should be:

"select * from student where S_ID = " & ID
Jan 7 '08 #6
shaiful
89
Still not sure what you want, but easiest way to update a table is to turn your select query into an update query, by changing the query type via the query button on the Access command menu, and executing it accordingly.

By the way your syntax on the select query is incorrect. It should be:

"select * from student where S_ID = " & ID
Sorry Still i have a problem about variable with query. i mean how query will know or like with variable from form side?
Jan 7 '08 #7
puppydogbuddy
1,923 Expert 1GB
Sorry Still i have a problem about variable with query. i mean how query will know or like with variable from form side?
Ok, if you meant what you said, a variable can not be used directly in a query. What you can do is create a user defined function that references the variable, and then reference the Function in the query....or if you really meant a parameter, you can reference a parameter in the where clause of a query, for example.
Jan 8 '08 #8
shaiful
89
Ok, if you meant what you said, a variable can not be used directly in a query. What you can do is create a user defined function that references the variable, and then reference the Function in the query....or if you really meant a parameter, you can reference a parameter in the where clause of a query, for example.
Sorry 4 asking u a lot of Q, Actyally my problem is: i want to show some field on report from table and query will depend on user, such as serach by ID , just give me that idea pls. how query will recognize ID search? , thx again
Jan 9 '08 #9
puppydogbuddy
1,923 Expert 1GB
Sorry 4 asking u a lot of Q, Actyally my problem is: i want to show some field on report from table and query will depend on user, such as serach by ID , just give me that idea pls. how query will recognize ID search? , thx again

If you use a query as the record Source for the report, it would look like this:

"select * from student where S_ID = " & ID



If the S_ID in your report is not bound to the query, you could use the DLookup function to retrieve the S_ID
'
some control (textbox) in your report:
= DLookup("[ID]", "yourTableorQuery" , "S_ID = " & Report!ID)
Jan 9 '08 #10

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

Similar topics

2
by: berthelot samuel | last post by:
Hi everyone, I am currently trying to write a report based on a View of SQL Server. Basically, I have 3 tables : Hardware, SoftwareInstalled and Software with SoftwareInstalled that keeps track of...
1
by: Speed | last post by:
How to write informations from database in Page Header section like in Detal section of DataReport?
1
by: Gary | last post by:
Dear Is it possible using ASP to call VB6 DataReport? if yes any reference of creating those com+ of DataReport and Call method? Gary
0
by: David | last post by:
I have tried unsccessfully, to pass parameter values to a stored procedure that I'm using for a datareport. The stored procedure requires the input of an start date and end date for a search...
1
Awit
by: Awit | last post by:
Hello, I'm new here... I have a problem, I used DataReport in my program.. The problem is runtime error occur when i run the system, i can't make some modification at the table in database while...
5
by: anoopgopal007 | last post by:
Hi, I am using vb6 and datareport. I am updating the tables whle the program running. But the datareport doesnot show the updated information. Its always shows the previous value. But...
6
by: pramodrepaka | last post by:
hi this is pramod i am facing a small problem Private Sub Command_Click() Dim a As String a = InputBox("enter empno") If rs.State = 1 Then rs.Close rs.Open "select * from microbiology...
0
by: nishjee | last post by:
Hello friends, i need visual basic 6.0 code to export a datareport to html other than the defult option coming with datareport. I need this very urgently because when i am exporting the datareport...
9
smartchap
by: smartchap | last post by:
I have a table having 3 fields viz. SNo, FName and LName. The table has 10 records having SNo from 1 to 10. In DataReport I have 3 labels and 3 textboxes. I want to display all records from 1 to 10...
1
by: MaryKJolly | last post by:
I got this sample project from a website. But there is some syntax error in the statement which contains the CDate function. I can't detect the error? Can enybody help me? SUMMARY This article...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.