473,796 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Record Y of X question

I am trying to make a custom navigation label to display record Y of X.
Dev Ashish's code placed in the OnCurrent Event:

Private Sub Form_Current()
If Me.NewRecord Then
Me!lblNavigate. Caption = "New Record"
Else
With Me.RecordsetClo ne
.Bookmark = Me.Bookmark
Me!lblNavigate. Caption = "Record " & _
.AbsolutePositi on + 1 _
& " of " & .RecordCount
End With
End If
End Sub

I have a Sort Option Box that allows the user to select custom sorts.
I placed the following code in the AfterUpdate Event of the option box:
Select Case Me.optSortRecor ds.Value
Case 1
Me.FilterOn = False
Case 2
Me.Filter = "[DelegatedTo] Is Null"
Me.FilterOn = True
Case 3
Me.Filter = "[DelegatedTo] Is Not Null"
Me.FilterOn = True
Case 4
Me.Filter = "[DelegatedTo] Is Not Null"
Me.FilterOn = True
End Select

However, when a option is selected, it doesnt appear to update the
custom navigation count. I even tried placing Dev's code in the the
AfterUpdate code of the option box, with no luck.

Any suggestions?

Nov 13 '05 #1
2 1854
BerkshireGuy wrote:
I am trying to make a custom navigation label to display record Y of X.
Dev Ashish's code placed in the OnCurrent Event:

Private Sub Form_Current()
If Me.NewRecord Then
Me!lblNavigate. Caption = "New Record"
Else
With Me.RecordsetClo ne
.Bookmark = Me.Bookmark
Me!lblNavigate. Caption = "Record " & _
.AbsolutePositi on + 1 _
& " of " & .RecordCount
End With
End If
End Sub

I have a Sort Option Box that allows the user to select custom sorts.
I placed the following code in the AfterUpdate Event of the option box:
Select Case Me.optSortRecor ds.Value
Case 1
Me.FilterOn = False
Case 2
Me.Filter = "[DelegatedTo] Is Null"
Me.FilterOn = True
Case 3
Me.Filter = "[DelegatedTo] Is Not Null"
Me.FilterOn = True
Case 4
Me.Filter = "[DelegatedTo] Is Not Null"
Me.FilterOn = True
End Select

However, when a option is selected, it doesnt appear to update the
custom navigation count. I even tried placing Dev's code in the the
AfterUpdate code of the option box, with no luck.

Any suggestions?


Why not just use the Navigation buttons? It shows the Record X of Y.

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2
Sorry for my english.
I think that the problem of the recordcount and absolutepositio n is that
they are properties of the recordset asociated with the form, so if you
filter it, you are not changing the recordset. My solution will be that when
you change the option box you will do the filter as an SQL statement
changing the Recordsource property of the form. It will do that the
recorcount and absolute position will be OK.

Select Case Me.optSortRecor ds.Value
Case 1
Me.RecordSource = "SELECT * FROM YourTable"
Case 2
Me.RecordSource = "SELECT * FROM YourTable WHERE DelegatedTo IS NULL"
............... .........

Another suggestion is that you have to be carefull with the AbsolutePositio n
property because it will not return any good value depending on the type of
recordset (dynamic and forwardonly will fail) and if you use it with a DAO
it is base 0 and if you use it with an ADO it is base 1.

"BerkshireG uy" <bd*****@yahoo. com> escribió en el mensaje
news:11******** *************@g 44g2000cwa.goog legroups.com...
I am trying to make a custom navigation label to display record Y of X.
Dev Ashish's code placed in the OnCurrent Event:

Private Sub Form_Current()
If Me.NewRecord Then
Me!lblNavigate. Caption = "New Record"
Else
With Me.RecordsetClo ne
.Bookmark = Me.Bookmark
Me!lblNavigate. Caption = "Record " & _
.AbsolutePositi on + 1 _
& " of " & .RecordCount
End With
End If
End Sub

I have a Sort Option Box that allows the user to select custom sorts.
I placed the following code in the AfterUpdate Event of the option box:
Select Case Me.optSortRecor ds.Value
Case 1
Me.FilterOn = False
Case 2
Me.Filter = "[DelegatedTo] Is Null"
Me.FilterOn = True
Case 3
Me.Filter = "[DelegatedTo] Is Not Null"
Me.FilterOn = True
Case 4
Me.Filter = "[DelegatedTo] Is Not Null"
Me.FilterOn = True
End Select

However, when a option is selected, it doesnt appear to update the
custom navigation count. I even tried placing Dev's code in the the
AfterUpdate code of the option box, with no luck.

Any suggestions?

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3874
by: Tim Marshall | last post by:
This is an embarrassing question to which I should know the answer, but I am not 100% sure of myself. My applications, whether they are Jet or Oracle usually deal with reporting on existing apps that others have done and except for the odd single user app, I don't do many transaction type applications.... Anyways, I have an unbound form which is a data entry form for new records or in "add record" mode. Say this form is for creating...
1
4318
by: Tom Lee | last post by:
Hi Guys, Firstly thanks for all the help you have providing me... I have another question I was stuck with. Here is a simple code dim strsql as string dim scr as recordset
3
14129
by: John Ortt | last post by:
> I have a table of dates in ascending order but with varying intervals. I > would like to create a query to pull out the date (in field 1) and then pull > the date from the subsequent record (and store it in field 2). > > I would like to run a query that returns all the data in the table plus the > record number, in a similar sense to the getuser() command to get the User's > Identity, I would like a GetRecord() command.
5
3756
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for Office 2000. I am creating a database to track student athletes. I have created the following tables. The table title is to the far left, with fields under each. The common field will be the StudentID field, which is their student number assigned...
4
1736
by: Richard | last post by:
In normal asp i used --------- objRS.Open "tbl_Nieuws", objConn, 1, 3 objRS.AddNew objRS.Fields("N_Datum") = FormatDateTime(Now(),2) objRS.Fields("N_Title") = ReplaceHTML(Upload.Form("title")) objRS.Fields("N_Intro") = ReplaceHTML(Upload.Form("intro")) objRS.Fields("N_Body") = ReplaceHTML(Upload.Form("body"))
9
424
by: Greg | last post by:
Binding Manager & dataset - won't add record I've got an untyped dataset with controls bound through code. The user can select a question number from a bound combobox, and the question number and question text are displayed in bound textboxes. This part works fine. When I go to add a new record, the textboxes clear as they should. I enter a new question number and tab to the textbox for the question text. At this point, the text for the...
0
1242
by: jakev2003 | last post by:
I have a form that has values from many different tables. Here are the tables: - Questions(ID, UserID, Question) - Users(UserID, Name, Email_Address, Other_Info) So when I browse through each record, I see the question and who submits the question. I can also modify the fields of both tables. However, when I want to add a new question, I can start filling out the
1
1429
by: Ryker | last post by:
I have a lengthy form containing several fields of data. Each record that is entered is given a record identification number. Sometimes the user gets midway into the form and has to stop to display another record. The current unfinished record is saved and retrieved later using the lookup field built into the form. My question: Is it possible to build into the form a "retrieve" button that could pull this unfinished record...
10
34073
by: john | last post by:
In a form, when you arrive in a new record, what event is trigerred and in which object? I can't find such an event. I need to reset a value when the user arrives in a next record. Thanks, john
2
1679
by: glynester | last post by:
I have some code that works off the update event of a textbox field (which is a part of a record in a continuous form). If certain conditions are met (following the updating of the field), I want a warning message to flash up and then the cursor must flash in the textbox relating to that record. So, if a user updates the field on the 1st record and then clicks on the 10th record (or anywhere), the warning message (if appropriate) must appear...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10187
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.