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.
DataReport
Collapse
X
-
Originally posted by shaifulHi 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.
output as an Access report created report designer
_______________ _______________ ______________
DoCmd.OpenRepor t "yourReport ", acViewPreview
or output and save as a Word rtf:
_______________ ___________
DoCmd.OutputTo acOutputReport, strReportName, "c:\Temp\" & strReportName & ".rtf", False -
Originally posted by puppydogbuddyTo output a report in VBA, you can (among other things):
output as an Access report created report designer
_______________ _______________ ______________
DoCmd.OpenRepor t "yourReport ", acViewPreview
or output and save as a Word rtf:
_______________ ___________
DoCmd.OutputTo acOutputReport, strReportName, "c:\Temp\" & strReportName & ".rtf", False
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 againComment
-
Originally posted by shaifulHi I make a report by using access and call it in vba code : DoCmd.OpenRepor t "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
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.Comment
-
Originally posted by puppydogbuddyHi 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.
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 againComment
-
Originally posted by shaifulHi 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
By the way your syntax on the select query is incorrect. It should be:
"select * from student where S_ID = " & IDComment
-
Originally posted by puppydogbuddyStill 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 = " & IDComment
-
Originally posted by shaifulSorry Still i have a problem about variable with query. i mean how query will know or like with variable from form side?Comment
-
Originally posted by puppydogbuddyOk, 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.Comment
-
Originally posted by shaifulSorry 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]", "yourTableorQue ry" , "S_ID = " & Report!ID)Comment
Comment