Hi i need help guys, can some body tell how to count records and display it in a label,,, i have a program that has a database in access, a simple databse program, i use adodc,,, the program stores name, address, phone number, and student number, its already running, but the thing is i wanted to be able to display how many records do i have in my program,
hope there's someone who can help or give an idea on how to solve my problem. thank you in advance.
5 1630
Hi. Can you post the code you have already at the point you want to count the records please?
- Private Sub Command2_Click()
-
-
-
If Adodc1.Recordset.EOF = True Then
-
MsgBox ("No more Records")
-
Text1.Locked = True
-
Text2.Locked = True
-
Text3.Locked = True
-
Text4.Locked = True
-
-
End If
-
End Sub
-
-
Private Sub Command3_Click()
-
Adodc1.Recordset.MovePrevious
-
-
If Adodc1.Recordset.BOF = True Then
-
MsgBox ("No more Previous Records")
-
End If
-
-
End Sub
So far that the code am still workin for ADDING & DELETING records, for the mean time am adding records through access but not in the program it self, thats one thing i need to know on how i can add & delete records without going to microsoft access...
This should get you the number of records: - Adodc1.Recordset.MoveLast
-
txtRecordCount.Text = Adodc1.Recordset.RecordCount
Adding and Deleting will be in your help for adodc
You should give your command buttons useful names so that you can distinguish between them in code e.g.
cmdAddNew
or
cmdMoveNext
Hi i need help guys, can some body tell how to count records and display it in a label,,, i have a program that has a database in access, a simple databse program, i use adodc,,, the program stores name, address, phone number, and student number, its already running, but the thing is i wanted to be able to display how many records do i have in my program,
hope there's someone who can help or give an idea on how to solve my problem. thank you in advance.
see this can be done in 2 ways use qry like select count(1) from tblname
count(1) is available in ora
and other way is to use recordcount as willakawill sugets
hello ive just figured out how to make my program work as i want too.
for contributions here my code::
Private Sub Command1_Click()
adoConnect.Recordset.AddNew
Text1.SetFocus
End Sub
Private Sub Command2_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox ("No record/s deleted"), vbCritical
Text1.Text = "<Blank>"
Text2.Text = "<Blank>"
Else
adoConnect.Recordset.Delete
adoConnect.Refresh
adoConnect.Recordset.MoveNext
adoConnect.Refresh
MsgBox ("Record Deleted!")
End If
End Sub
Private Sub Command3_Click()
Dim ans As String
If Text1.Text = "" And Text2.Text = "" Then
ans = MsgBox("No more previous records!!! " & _
"Do you want to procedd?", vbYesNo)
adoConnect.Recordset.MoveFirst
Else
adoConnect.Recordset.MovePrevious
End If
End Sub
Private Sub Command4_Click()
Dim ans As String
adoConnect.Recordset.MoveNext
If adoConnect.Recordset.EOF = True Then
ans = MsgBox("No more Records!!! " & _
"Do you want to procedd?", vbYesNo)
If ans = vbNo Then
End
Else
adoConnect.Recordset.MoveFirst
End If
End If
End Sub
Private Sub Command5_Click()
Label1.Caption = adoConnect.Recordset.RecordCount & " " & "Record/s"
End Sub
Private Sub Command6_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox ("Cannot save blank entries!"), vbCritical
Else
MsgBox ("Record was save")
adoConnect.Recordset.Update
End If
If Text1.Text = "<Blank>" And Text2.Text = "<Blank>" Then
MsgBox ("Record was save!"), vbCritical
adoConnect.Recordset.Update
End If
End Sub
thanks for all the help!!!! i really appreciate it... Thank you VB Masters.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Hari Om |
last post by:
Here are the details of my error log files:
I execute the command and get following message at console:
----------------------------------------------------------------------
../sqlldr...
|
by: thomasp |
last post by:
I am trying to get a record count of a PHP query on a MS Acess database
using ODBC with a DSN for MS ACCESS connection. I got this code from the
PHP manual user notes. It seems to return the...
|
by: Justin Koivisto |
last post by:
I am trying to create a report that displays a name of an advertising
source and count of the number of times it was hit between certain date
ranges. The data is split between two different...
|
by: 6thirty |
last post by:
Hi,
I've created a stocktaking database using Access XP. This is indexed by two
fields - part number and shelf location.
I am currently inputting all the data via a form. When I have entered a...
|
by: Scott269 |
last post by:
So I've got an old MS Works database I imported into Access. I needed
a primary key so I created a record number field that was just the
record number I manually inserted when I entered it in the...
|
by: darrel |
last post by:
I'm trying to whip up a fancy repeater control that will put records into a
two-column table for me.
This is how I envision it working:
itemtemplate
if record count = odd then write out the...
|
by: Mike |
last post by:
I have a form where I have turned off the default navigation buttons. I
then created my own. This works fine. The only questions that I have is on
the default navigation buttons it shows total...
|
by: Peter W Johnson |
last post by:
Hi guys,
I have a problem with a datagrid record count. Here is the code:-
<snip>
Public Class frmMerchantDeposit
Inherits System.Windows.Forms.Form
Dim myconnection As New...
|
by: Catch_22 |
last post by:
Hi,
I have a stored procedure that has to extract the child records for
particular parent records.
The issue is that in some cases I do not want to extract all the child
records only a...
|
by: Phil Stanton |
last post by:
Sorry to repost, but am having another look at deleting a record.
I have a form (Member) and have removed all the event procedures associated
with the Form (OnCurrent, OnDelete, OnActivate etc)...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
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...
|
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: 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...
|
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...
|
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,...
| |