473,399 Members | 2,278 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,399 software developers and data experts.

Query to Subform/Subreport

Hi there

The code is working fine but I don't know how to show the output of: "select count(leads.id) from leads".
I did put the "Subform/Subreport" control on the Form but have no idea what next.
How can I tell VB to put the output of query into "Subform/Subreport" or any other control.

Best Regards

Pete


Private Sub Command11_Click()

Dim conConnector As ADODB.Connection

Dim strStatement As String

Set conConnector = New ADODB.Connection

conConnector.Open "DSN=NORAD - HOME;UID=crystal;PWD=111111;"

strStatement = ""select count(leads.id) from leads

conConnector.Execute strStatement

conConnector.Close
Set conConnector = Nothing

End Sub
Apr 6 '08 #1
1 2011
MikeTheBike
639 Expert 512MB
Hi there

The code is working fine but I don't know how to show the output of: "select count(leads.id) from leads".
I did put the "Subform/Subreport" control on the Form but have no idea what next.
How can I tell VB to put the output of query into "Subform/Subreport" or any other control.

Best Regards

Pete


Private Sub Command11_Click()

Dim conConnector As ADODB.Connection

Dim strStatement As String

Set conConnector = New ADODB.Connection

conConnector.Open "DSN=NORAD - HOME;UID=crystal;PWD=111111;"

strStatement = ""select count(leads.id) from leads

conConnector.Execute strStatement

conConnector.Close
Set conConnector = Nothing

End Sub
Hi

Perhaps this ??

strStatement = "select count(leads.id) As ID_Count from leads"

Dim rs as New ADODB.Recordset

rs.Open strStatemen, conConnector

TextBoxControl = rs("ID_Count")

rs.Close

??

MTB
Apr 7 '08 #2

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

Similar topics

3
by: Illya Havsiyevych | last post by:
Hello All I have splitted my MDB into MDE and data MDB. In old whole MDB I have next piece of code to create an instance of a form with subform. ..... Dim objForm As New ...
5
by: C L Humphreys | last post by:
Hi, When performing a large join, say on personaldetails against various other tables where there is a one to many relationship, obviously the first table will be repeated many times with the...
1
by: krish_4u_only | last post by:
Hi, I have designed a subreport - record source is on crosstab query. crosstab query is designed on union query. The sub report is working fine when it is opened individually. but if i place it on...
1
by: John | last post by:
I'm building a report where each row represents one month and its 1 to 5 weeks. A report query groups the source table date into a "month and year" expression. A subreport links to the main report...
3
by: Steven | last post by:
OK.. Here's my situation. I have a subform on a parent form. When the parent form is loaded, the subreport queries data from a table in the DB. The parent form has a couple of text boxes for data...
1
by: hakunamatata5254 | last post by:
Hi all, In my project of multiple forms (main form, subform1, 2 , 3 etc) (Main form is Employees, Subforms are Attendance, salary details, payment) Now i want to calculate the payment based...
3
by: russellhq | last post by:
Hi, I'm fairly new to access and have a little trouble with a crosstab query I've setup. I have a main form where the user selects a project name and below in a subform, a crosstab query is...
25
by: hjozinovic | last post by:
Hi! I have a MainForm and a SubForm on it. They're linked and can be filtered, sorted etc... I designed MainReport and SubReport that should match filter and sort criteria from MainForm and...
3
by: csolomon | last post by:
Hello, I would like to copy a calculated control of an unbound control on to a report. On my form (F_SampleRequest) i have a button which opens the report. Here is the code for the button: ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.