From: gagecres on
Boom! This worked perfectly. Thanks for sticking with me on this.

"Gina Whipp" wrote:

>
>
> Okay, then let's forget that and use this...
>
> Create a text box and copy/paste the below...
>
> =IIf([CurrentRecord]>(Count(*)),'No Record',('Contract ' & [CurrentRecord] &
> ' of ' & Count(*))) & " line(s)"
>
>
> Note, where is says 'No Record', you can have it say anything or nothing.
>
> --
> 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:CF04DD6F-2837-4EAB-99D1-EE2D04469458(a)microsoft.com...
> The code you gave me works fine if the first parent record that appears on
> the form has records in the subform. If that first parent record has no
> records in the subform, that's when I get the "No Current Records" error as
> soon as I open the database and the debugger highlights the ".MoveLast"
> statement.
>
> "Gina Whipp" wrote:
>
> > Is me txtRec_Count a numeric field? OR just and unbound text box? Please
> > remove *.Value* Is this a form or subform and does it have any records?
> >
> > What message if any do you get?
> >
> > --
> > 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:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7(a)microsoft.com...
> > Here is the code I am using:
> >
> > With Me.RecordsetClone
> > .MoveLast
> > Me.txt_Rec_Count.Value = Me.CurrentRecord & " of " & .RecordCount
> > &
> > " line(s)"
> > End With
> >
> > Also, I commented out the OnLoad lines
> >
> > "Gina Whipp" wrote:
> >
> > > 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: Gina Whipp on
gagecres,

No problem... thanks for posting back and letting us know!

--
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:4C37705F-63F7-488D-8B30-F174A2D3DAB1(a)microsoft.com...
Boom! This worked perfectly. Thanks for sticking with me on this.

"Gina Whipp" wrote:

>
>
> Okay, then let's forget that and use this...
>
> Create a text box and copy/paste the below...
>
> =IIf([CurrentRecord]>(Count(*)),'No Record',('Contract ' & [CurrentRecord]
> &
> ' of ' & Count(*))) & " line(s)"
>
>
> Note, where is says 'No Record', you can have it say anything or nothing.
>
> --
> 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:CF04DD6F-2837-4EAB-99D1-EE2D04469458(a)microsoft.com...
> The code you gave me works fine if the first parent record that appears on
> the form has records in the subform. If that first parent record has no
> records in the subform, that's when I get the "No Current Records" error
> as
> soon as I open the database and the debugger highlights the ".MoveLast"
> statement.
>
> "Gina Whipp" wrote:
>
> > Is me txtRec_Count a numeric field? OR just and unbound text box?
> > Please
> > remove *.Value* Is this a form or subform and does it have any records?
> >
> > What message if any do you get?
> >
> > --
> > 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:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7(a)microsoft.com...
> > Here is the code I am using:
> >
> > With Me.RecordsetClone
> > .MoveLast
> > Me.txt_Rec_Count.Value = Me.CurrentRecord & " of " &
> > .RecordCount
> > &
> > " line(s)"
> > End With
> >
> > Also, I commented out the OnLoad lines
> >
> > "Gina Whipp" wrote:
> >
> > > 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
> > > > >
> > > > > .
> > > > >
> > > >
> > > >
> > > > .
> > > >
> > >
> > >
> > > .
> > >
> >
> > .
> >
>
> .
>