General discussion

Locked

VB6 to Access report using Automation

By sokolili ·
How to input FROM date and TO date from text box on VB form to text boxes on Access report, query data using Automation, ADO, ACCESS2000 database
To preview report I'm using code objAccess.DoCmd.OpenReport rptName acPreview, , strWhere. Criteria from VBform have to be placed in strWhere.

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB6 to Access report using Automation

by john_wills In reply to VB6 to Access report usin ...

Not to text boxes on the report but to labels. In the form's VBA assign the dates to public dates: parameter.EndDate:= me.EndDate
parameter.StartDate:= me.StartDate
in the report's Open event VBA:
me.EndDate.Caption:= parameter.EndDate
me.StartDate.Caption:=parameter.StartDate
The "caption" is not an option shown as you type, but it does get recognized.

Collapse -

VB6 to Access report using Automation

by sokolili In reply to VB6 to Access report usin ...

This code is not working. Parameter object in VB form has to be defined from proper parent object in ADO object model wich will connect to Parameter query on the ACCESS side thru Automation wich used in this case. Maybe in addition to ADO, I need to use DAO? I need the syntax wich will make possible to input parameters on VB form and print or preview ACCESS report with this parameters.

Collapse -

VB6 to Access report using Automation

by john_wills In reply to VB6 to Access report usin ...

I meant that you should first define parameter; it seemed so obvious I did not say so.
public type param
EndDate AS date
StartDate AS date
end type

public parameter AS param

Collapse -

VB6 to Access report using Automation

by sokolili In reply to VB6 to Access report usin ...

Your proposed solution is not work. Did you test this solution?
I still need the help for this problem.

Collapse -

VB6 to Access report using Automation

by john_wills In reply to VB6 to Access report usin ...

I use this technique frequently, so I suppose I have tested it within your meaning. To decide what is going wrong with your implementation I need to know just what does not work. By use of msgbox you should be able to tell whether the dates are getting to the parameter and whether they are getting from the parameter to the report. If you like you can send me code extracts by email, indicating which extract comes from the form, which from the report, and which from any other module.

Collapse -

VB6 to Access report using Automation

by sokolili In reply to VB6 to Access report usin ...

Poster rated this answer

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums