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

wrong display of absolute position and recordcount

I want my form to display the absolute position and the recordcount of the records in the database but it keeps shoing me -1 for both . Why?
this is the code

Expand|Select|Wrap|Line Numbers
  1. Private Sub MnuOVehType_Click()
  2. Load FrmTypeEntry
  3. For i = 1 To 4
  4.     FrmTypeEntry.cmdControl(i).Enabled = True
  5. Next i
  6. For j = 0 To 3
  7.     FrmTypeEntry.cmdNavigate(j).Enabled = True
  8. Next j
  9. FrmTypeEntry.TxtType.Locked = True
  10. FrmTypeEntry.TxtType.Text = RsVehType("txtVEHTYPE")
  11. FrmTypeEntry.Label1.Caption = "VEHICLE TYPE " & RsVehType.AbsolutePosition & "of" & RsVehType.RecordCount
  12. End Sub
  13.  
Dec 14 '06 #1
3 2514
Killer42
8,435 Expert 8TB
Just a couple of thoughts...
  • RecordCount is often simply 0 (no match) or 1 (one or more matches) until you move to the end of the recordset to force the Jet engine to count them. You might try doing MoveLast...MoveFirst somewhere before accessing the RecordCount, just to see what happens.
  • I'm not familiar with AbsolutePosition, but my guess would be that it's the "absolute" position within that recordset, not within the table. I don't think Access keeps any unique record position or record number - you have to do that yourself by using an autonumber field.
Well, hope this doesn't lead you too far astray. :)
Dec 15 '06 #2
You can only get the record count and absolute position if you open the recordset using adopenkeyset or adopendynamic as the cursor type. The other cursor types don't populate the recordset until requested so the recordcount & absolute position are not known and always appear as -1
Dec 15 '06 #3
RESOLVED

Thank you all for your suggestion. I set the cursor location to aduseclient and it works.
Dec 15 '06 #4

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

Similar topics

2
by: Ryan | last post by:
Access97 I hope someone out there can help. This is driving me crazy. Basically, I am trying to recreate VBA's built in navigation feature (The one that allows you to move first, next,...
6
by: dale zhang | last post by:
Hi, I build a web form with a 4-cell table on the top (flawlayout), followed by some labels and textboxes (gridlayout). The web form is displayed well in dell m60 laptop with all resolution...
2
by: Niks | last post by:
Hi, I have just now installed VS.NET on my system and created basic .aspx files using <asp:label id="Message1" font-size="16" font-bold="true" forecolor="red" runat=server>Test</asp:label> tags...
5
by: CES | last post by:
All, I was hoping that someone might be able to help me with a few questions on Aligning Block Elements properly... Basically I have a row that has a fixed width of 900px. Within the row their is...
3
by: Jannette | last post by:
I've got this to finally work in IE (its only taken me 2 days solid), but now mozilla isn't displaying the text on the same line as the image. I'm a newby at CSS, and I've think I've worked on trying...
1
by: bluepiper | last post by:
Im using VB6. On rowcolchange event of may datagrid, im using the Frame caption to get the selected data. The problem is when I select the data on the grid. Its not showing the absolute position,...
1
idsanjeev
by: idsanjeev | last post by:
<%@ Language =vbscript%> <% Option Explicit %> <html> <head><TITLE>VOICE OF BARAUNIANS</TITLE></head> <body> <!--#include file="front.inc"--> <div style="Position:Absolute; width:700; TOP:0;...
5
by: montybytes | last post by:
Hi there, Although, I have already placed this question in the HTML/CSS section, perhaps it might be worthwhile asking the question here as well. I have a JavaScript function which retrieves...
2
by: everly | last post by:
Hi, I'm helping my friends band and making their MySpace. I messed something up and I can't figure out what it is. Everything is all out of whack on the bottom half of the page. The comments...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
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?
1
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 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.