From: Gina Whipp on 4 Mar 2010 12:23 gagecres, I use on the On_Current event of the form... With Me.RecordsetClone .MoveLast Me.txtPage = Me.CurrentRecord & " of " & .RecordCount & " line(s)" End With Make sure to place a text box on your form names... *txtPage* -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "gagecres" <gagecres(a)discussions.microsoft.com> wrote in message news:5E01823D-4916-4E53-B80C-42D68C75743D(a)microsoft.com... I also noticed that the total records number always starts out as 1, even if I have more than 1 record in the subform associated with the current record on the parent form. For example, it says "Record 1 of 1" even though there are a total of 3 records. However, when I go to the next record in the subform it updates to the correct number of total records (i.e. "Record 1 of 3"). How do I get it to say "Record 1 of 3" for the subform record when I first get to the parent record? "Linq Adams via AccessMonster.com" wrote: > Private Sub Form_Load() > DoCmd.GoToRecord , , acNext > DoCmd.GoToRecord , , acFirst > End Sub > > > Private Sub Form_Current() > Me.Caption = "Record " & CurrentRecord & " Of " & > RecordsetClone.RecordCount & " Records" > End Sub > > This code places the info in the form's title area. To place it in a > Label, > substitute > > Me.LableName.Caption > > for > > Me.Caption. > > To place it in a TextBox, substitute > > Me.TextBoxName.Value > > for > > Me.Caption. > > -- > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1 > > . >
From: Gina Whipp on 4 Mar 2010 12:29 gagecres, Why are you placing *DoCmd.GoToRecord...* on the On_Load event? -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "gagecres" <gagecres(a)discussions.microsoft.com> wrote in message news:A52F16B8-F5DB-448E-BDF5-C037DCB532EF(a)microsoft.com... This worked great! Thanks a lot. One question though. I get an error on the "DoCmd.GoToRecord , , acNext" line when I first open the form. I assume this is because there are no records in the database yet. How do I fix this? "Linq Adams via AccessMonster.com" wrote: > Private Sub Form_Load() > DoCmd.GoToRecord , , acNext > DoCmd.GoToRecord , , acFirst > End Sub > > > Private Sub Form_Current() > Me.Caption = "Record " & CurrentRecord & " Of " & > RecordsetClone.RecordCount & " Records" > End Sub > > This code places the info in the form's title area. To place it in a > Label, > substitute > > Me.LableName.Caption > > for > > Me.Caption. > > To place it in a TextBox, substitute > > Me.TextBoxName.Value > > for > > Me.Caption. > > -- > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1 > > . >
From: gagecres on 4 Mar 2010 14:56 I still get an error saying: "No current record." When I debug it, it highlights ".MoveLast". "Gina Whipp" wrote: > gagecres, > > I use on the On_Current event of the form... > > With Me.RecordsetClone > .MoveLast > Me.txtPage = Me.CurrentRecord & " of " & .RecordCount & " line(s)" > End With > > Make sure to place a text box on your form names... *txtPage* > -- > Gina Whipp > 2010 Microsoft MVP (Access) > > "I feel I have been denied critical, need to know, information!" - Tremors > II > > http://www.regina-whipp.com/index_files/TipList.htm > > "gagecres" <gagecres(a)discussions.microsoft.com> wrote in message > news:5E01823D-4916-4E53-B80C-42D68C75743D(a)microsoft.com... > I also noticed that the total records number always starts out as 1, even if > I have more than 1 record in the subform associated with the current record > on the parent form. For example, it says "Record 1 of 1" even though there > are a total of 3 records. However, when I go to the next record in the > subform it updates to the correct number of total records (i.e. "Record 1 of > 3"). How do I get it to say "Record 1 of 3" for the subform record when I > first get to the parent record? > > "Linq Adams via AccessMonster.com" wrote: > > > Private Sub Form_Load() > > DoCmd.GoToRecord , , acNext > > DoCmd.GoToRecord , , acFirst > > End Sub > > > > > > Private Sub Form_Current() > > Me.Caption = "Record " & CurrentRecord & " Of " & > > RecordsetClone.RecordCount & " Records" > > End Sub > > > > This code places the info in the form's title area. To place it in a > > Label, > > substitute > > > > Me.LableName.Caption > > > > for > > > > Me.Caption. > > > > To place it in a TextBox, substitute > > > > Me.TextBoxName.Value > > > > for > > > > Me.Caption. > > > > -- > > Message posted via AccessMonster.com > > http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1 > > > > . > > > > > . >
From: Gina Whipp on 4 Mar 2010 16:27 Please post the exactly the code you are using here... And if you have no reason for the DoCmd.GoToRecord lines, remove them from the On_Load event. -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "gagecres" <gagecres(a)discussions.microsoft.com> wrote in message news:3843298D-90EB-473F-A75D-58E961D9AE0A(a)microsoft.com... I still get an error saying: "No current record." When I debug it, it highlights ".MoveLast". "Gina Whipp" wrote: > gagecres, > > I use on the On_Current event of the form... > > With Me.RecordsetClone > .MoveLast > Me.txtPage = Me.CurrentRecord & " of " & .RecordCount & " > line(s)" > End With > > Make sure to place a text box on your form names... *txtPage* > -- > Gina Whipp > 2010 Microsoft MVP (Access) > > "I feel I have been denied critical, need to know, information!" - Tremors > II > > http://www.regina-whipp.com/index_files/TipList.htm > > "gagecres" <gagecres(a)discussions.microsoft.com> wrote in message > news:5E01823D-4916-4E53-B80C-42D68C75743D(a)microsoft.com... > I also noticed that the total records number always starts out as 1, even > if > I have more than 1 record in the subform associated with the current > record > on the parent form. For example, it says "Record 1 of 1" even though > there > are a total of 3 records. However, when I go to the next record in the > subform it updates to the correct number of total records (i.e. "Record 1 > of > 3"). How do I get it to say "Record 1 of 3" for the subform record when I > first get to the parent record? > > "Linq Adams via AccessMonster.com" wrote: > > > Private Sub Form_Load() > > DoCmd.GoToRecord , , acNext > > DoCmd.GoToRecord , , acFirst > > End Sub > > > > > > Private Sub Form_Current() > > Me.Caption = "Record " & CurrentRecord & " Of " & > > RecordsetClone.RecordCount & " Records" > > End Sub > > > > This code places the info in the form's title area. To place it in a > > Label, > > substitute > > > > Me.LableName.Caption > > > > for > > > > Me.Caption. > > > > To place it in a TextBox, substitute > > > > Me.TextBoxName.Value > > > > for > > > > Me.Caption. > > > > -- > > Message posted via AccessMonster.com > > http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1 > > > > . > > > > > . >
From: Linq Adams via AccessMonster.com on 4 Mar 2010 18:15 Sorry, the line DoCmd.GoToRecord , , acNext was a typo. Should have read DoCmd.GoToRecord , , acLast To account for no records being in the recordsource, try this revision Private Sub Form_Load() DoCmd.GoToRecord , , acLast DoCmd.GoToRecord , , acFirst End Sub Private Sub Form_Current() Dim intX As Integer intX = DCount("*", "TableOrQueryName") If intX < 1 Then Me.Caption = "There Are No Records" Else Me.Caption = "Record " & CurrentRecord & " Of " & RecordsetClone. RecordCount & " Records" End If End Sub -- Message posted via http://www.accessmonster.com
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: re-linking backend on shared folder Next: Disallow field sorting by users |