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

Get recordcount of records in form

Hi my name is Daniel,

I am in the middle of building a database. The problem is i have turned some queries into forms, and i was wondering if it was possible to insert the total of records into the actual form.This is because it is difficult to see the total amount of records in the record tab below the actual form.

Also i was wondering how i could import a CSV document?

Finally I've been trying to find a way of getting access to automatically import the file when the database is opened?

P.s i've also noticed that the file get bigger everytime i import a table, even when the old one has been deleted. Is there an explanation for this?

I'd appreciate any advice given from you experts.

Many thanks

Regards Daniel
Nov 8 '07 #1
3 1659
MMcCarthy
14,534 Expert Mod 8TB
Hi my name is Daniel,

I am in the middle of building a database. The problem is i have turned some queries into forms, and i was wondering if it was possible to insert the total of records into the actual form.This is because it is difficult to see the total amount of records in the record tab below the actual form.
Create a text box in the form footer (txtRecCount) and put the following code in the Form Current Event
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. Dim rs As DAO.Recordset
  3.  
  4.     Set rs = Me.RecordsetClone
  5.     rs.MoveLast
  6.     rs.MoveFirst
  7.     Me.txtRecCount = rs.RecordCount
  8.  
  9.     Set rs = Nothing
  10.  
  11. End Sub
  12.  
Also i was wondering how i could import a CSV document?
Have a look at this tutorial.

http://www.thescripts.com/forum/showthread.php?t=585240

Finally I've been trying to find a way of getting access to automatically import the file when the database is opened?
Assuming you have the switchboard set to open on startup then just call the code from the Form Load event of the switchboard.

P.s i've also noticed that the file get bigger everytime i import a table, even when the old one has been deleted. Is there an explanation for this?
Access holds all memory until compact and repair is run on the database. Go to Tools - Options - General tab and tick the "Compact on Close" option.

Note:
For future reference you should keep different questions in separate threads. Multiple questions can get very confusing in a thread.

Mary
Nov 9 '07 #2
Thanks For you help Mary
Nov 9 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Thanks For you help Mary
You're welcome
Nov 9 '07 #4

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

Similar topics

2
by: Jeff Boyer | last post by:
Hello everyone, Can someone tell me why a ADO recordset.recordcount would return a -1? I have confirmed that it has records in it by writing some values to the screen. Why can't I count the...
12
by: scott | last post by:
In LISTING 2, I have a SPROC that returns a recordset and a recordcount in SQL QA. I can access the Recordset with no problem. How can I grab the Recordcount with ASP code at the same time I'm...
4
by: jl | last post by:
Hello, I am trying to determine if a recordset is empty or not, and if it is empty print out a message saying no records found. I thought I could use rs.RecordCount but it always seems to return...
5
by: michael montagne | last post by:
Problem with this statement: sSQL = "SELECT * FROM Projects;" Set oDbe = CreateObject("DAO.DBEngine.36") oDbe.SystemDB = "myworkgrupfile.MDW" Set oWS = oDbe.CreateWorkspace("", "me", "") Set oDB...
1
by: Hasanain F. Esmail | last post by:
Hi All, I am using A2 for this database. I have a main form with bound fields of FlightNumber and FlightDate I also have a subform. This subform takes details of a passanger along with other...
1
by: JMCN | last post by:
hello- i have created a tabular form using records from a specific query. then users will filter out the specific data. the next step is to take the count of the current records (daily open...
4
by: don.fleming | last post by:
Hi folks: Am doing a VBA SQL Select stmt with multiple rows found and not getting RecordCount > 1. I've verified there are multiple rows found by copying my SQL stmt from Debug window and pasting...
2
by: Andy_Khosravi | last post by:
This is probably one of the most simple things to do in VB, yet somehow I've messed it up and cannot get it to work properly. I've used it dozens of times in the past, but for whatever reason I...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
1
by: Orchid | last post by:
Hello all, I have a Combo Box on a form with selection of a firm list. When the users select a firm from the Combo Box and if the firm has branch(es), a list of branch(es) of the firm opens in a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.