How do I add a record counter to my form

I would like to add my own record counter, like "Record # of #", to my form.  
How can I do this?
0
Utf
3/4/2010 2:04:01 AM
access.forms 6864 articles. 2 followers. Follow

21 Replies
1512 Views

Similar Articles

[PageSpeed] 7

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

0
Linq
3/4/2010 2:21:11 AM
Sorry, meant to add this caveat:

This only displays the position of a record within the RecordSource of the
form. It has nothing to do with its position within the underlying table.
Additions and deletions will change this, assuming the RecordSourse is
requeried after each of these is done.

-- 
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1

0
Linq
3/4/2010 2:24:52 AM
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
> 
> .
> 
0
Utf
3/4/2010 3:29:02 PM
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
> 
> .
> 
0
Utf
3/4/2010 3:46:02 PM
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@discussions.microsoft.com> wrote in message 
news:5E01823D-4916-4E53-B80C-42D68C75743D@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
>
> .
> 


0
Gina
3/4/2010 5:23:50 PM
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@discussions.microsoft.com> wrote in message 
news:A52F16B8-F5DB-448E-BDF5-C037DCB532EF@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
>
> .
> 


0
Gina
3/4/2010 5:29:03 PM
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@discussions.microsoft.com> wrote in message 
> news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> >
> > .
> > 
> 
> 
> .
> 
0
Utf
3/4/2010 7:56:01 PM
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@discussions.microsoft.com> wrote in message 
news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> >
> > .
> >
>
>
> .
> 


0
Gina
3/4/2010 9:27:18 PM
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

0
Linq
3/4/2010 11:15:27 PM
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@discussions.microsoft.com> wrote in message 
> news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> > news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> > >
> > > .
> > >
> >
> >
> > .
> > 
> 
> 
> .
> 
0
Utf
3/5/2010 1:55:01 PM
It is still not showing the correct total number.  Here is my code:

Private Sub Form_Current()
    intX = DCount("*", "Heirs Table")

    If intX < 1 Then
      Me.txt_Rec_Count.Value = "0"
    Else
      Me.txt_Rec_Count.Value = "Heir #  " & CurrentRecord & "  of  " &   
RecordsetClone.RecordCount  
    End If
End Sub

Private Sub Form_Load()
    DoCmd.GoToRecord , , acLast
    DoCmd.GoToRecord , , acFirst
End Sub


"Linq Adams via AccessMonster.com" wrote:

> 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
> 
> .
> 
0
Utf
3/5/2010 2:15:01 PM
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@discussions.microsoft.com> wrote in message 
news:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7@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@discussions.microsoft.com> wrote in message
> news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> > news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> > >
> > > .
> > >
> >
> >
> > .
> >
>
>
> .
> 

0
Gina
3/5/2010 3:09:21 PM
Try checking the RecordCount of RecordsetClone, and breaking up the code a
little:

Debug.Print Me.RecordsetClone.RecordCount

Me.RecordsetClone.MoveLast
Me.txt_Rec_Count = Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount
& " line(s)"

Rather than using the Load event, perhaps something like this:

Dim lngCount as Long
Dim strCount as String

lngCount = Me.RecordsetClone.RecordCount

If lngCount = 0 Then
  strCount = "First Record"
  Else
    strCount = Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount & "
line(s)"
End If

Me.txt_Rec_Count = strCount

gagecres wrote:
>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
>
>> 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.
>[quoted text clipped - 60 lines]
>> 
>> .

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1

0
BruceM
3/5/2010 3:22:44 PM
txt_Rec_Count is an unbound text box.  I removed ".Value" and still got the 
same No Current Record error.  The form is a subform and yes it does have 
records in it.

"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@discussions.microsoft.com> wrote in message 
> news:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7@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@discussions.microsoft.com> wrote in message
> > news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> > > news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> > > >
> > > > .
> > > >
> > >
> > >
> > > .
> > >
> >
> >
> > .
> > 
> 
> .
> 
0
Utf
3/9/2010 2:19:02 PM
This did the trick.  Thanks a lot!

"BruceM via AccessMonster.com" wrote:

> Try checking the RecordCount of RecordsetClone, and breaking up the code a
> little:
> 
> Debug.Print Me.RecordsetClone.RecordCount
> 
> Me.RecordsetClone.MoveLast
> Me.txt_Rec_Count = Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount
> & " line(s)"
> 
> Rather than using the Load event, perhaps something like this:
> 
> Dim lngCount as Long
> Dim strCount as String
> 
> lngCount = Me.RecordsetClone.RecordCount
> 
> If lngCount = 0 Then
>   strCount = "First Record"
>   Else
>     strCount = Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount & "
> line(s)"
> End If
> 
> Me.txt_Rec_Count = strCount
> 
> gagecres wrote:
> >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
> >
> >> 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.
> >[quoted text clipped - 60 lines]
> >> 
> >> .
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1
> 
> .
> 
0
Utf
3/9/2010 2:26:01 PM
Spoke too soon. 

"gagecres" wrote:

> This did the trick.  Thanks a lot!
> 
> "BruceM via AccessMonster.com" wrote:
> 
> > Try checking the RecordCount of RecordsetClone, and breaking up the code a
> > little:
> > 
> > Debug.Print Me.RecordsetClone.RecordCount
> > 
> > Me.RecordsetClone.MoveLast
> > Me.txt_Rec_Count = Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount
> > & " line(s)"
> > 
> > Rather than using the Load event, perhaps something like this:
> > 
> > Dim lngCount as Long
> > Dim strCount as String
> > 
> > lngCount = Me.RecordsetClone.RecordCount
> > 
> > If lngCount = 0 Then
> >   strCount = "First Record"
> >   Else
> >     strCount = Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount & "
> > line(s)"
> > End If
> > 
> > Me.txt_Rec_Count = strCount
> > 
> > gagecres wrote:
> > >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
> > >
> > >> 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.
> > >[quoted text clipped - 60 lines]
> > >> 
> > >> .
> > 
> > -- 
> > Message posted via AccessMonster.com
> > http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1
> > 
> > .
> > 
0
Utf
3/9/2010 2:38:09 PM
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@discussions.microsoft.com> wrote in message 
> news:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7@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@discussions.microsoft.com> wrote in message
> > news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> > > news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> > > >
> > > > .
> > > >
> > >
> > >
> > > .
> > >
> >
> >
> > .
> > 
> 
> .
> 
0
Utf
3/9/2010 2:57:01 PM
gagecres,

Since all of the code you received here should work, let's check a few 
othwer things...

1.  This subform isn't continuous is it?
2.  How is the subform bound to the main form?
3.  Is the code on the subform or the main form?
4.  Is the code on the On_Current event of the subform?

-- 
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@discussions.microsoft.com> wrote in message 
news:0E9EE9FC-054F-42E8-892B-287EB1F1E3E9@microsoft.com...
txt_Rec_Count is an unbound text box.  I removed ".Value" and still got the
same No Current Record error.  The form is a subform and yes it does have
records in it.

"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@discussions.microsoft.com> wrote in message
> news:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7@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@discussions.microsoft.com> wrote in message
> > news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> > > news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> > > >
> > > > .
> > > >
> > >
> > >
> > > .
> > >
> >
> >
> > .
> >
>
> .
> 

0
Gina
3/9/2010 3:01:26 PM

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@discussions.microsoft.com> wrote in message 
news:CF04DD6F-2837-4EAB-99D1-EE2D04469458@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@discussions.microsoft.com> wrote in message
> news:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7@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@discussions.microsoft.com> wrote in message
> > news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> > > news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> > > >
> > > > .
> > > >
> > >
> > >
> > > .
> > >
> >
> >
> > .
> >
>
> .
> 

0
Gina
3/9/2010 4:22:56 PM
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@discussions.microsoft.com> wrote in message 
> news:CF04DD6F-2837-4EAB-99D1-EE2D04469458@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@discussions.microsoft.com> wrote in message
> > news:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7@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@discussions.microsoft.com> wrote in message
> > > news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> > > > news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> > > > >
> > > > > .
> > > > >
> > > >
> > > >
> > > > .
> > > >
> > >
> > >
> > > .
> > >
> >
> > .
> > 
> 
> .
> 
0
Utf
3/9/2010 5:54:04 PM
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@discussions.microsoft.com> wrote in message 
news:4C37705F-63F7-488D-8B30-F174A2D3DAB1@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@discussions.microsoft.com> wrote in message
> news:CF04DD6F-2837-4EAB-99D1-EE2D04469458@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@discussions.microsoft.com> wrote in message
> > news:297E5FE8-BA21-4FB0-9A76-FD2E2F7B5EF7@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@discussions.microsoft.com> wrote in message
> > > news:3843298D-90EB-473F-A75D-58E961D9AE0A@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@discussions.microsoft.com> wrote in message
> > > > news:5E01823D-4916-4E53-B80C-42D68C75743D@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
> > > > >
> > > > > .
> > > > >
> > > >
> > > >
> > > > .
> > > >
> > >
> > >
> > > .
> > >
> >
> > .
> >
>
> .
> 

0
Gina
3/9/2010 6:37:33 PM
Reply:

Similar Artilces:

count records in a date range
I have a worksheet in which I am trying to count the number of records in a date range. For example, the Submit_Date column contains the following dates/times (cells a1:a5): 12/17/2005 12:00:54 PM 12/16/2005 1:00:54 PM 12/17/2005 9:00:13 PM 12/10/2005 7:54:16 AM 12/17/2005 10:04:11 AM I would like to count the number of records with a Submit_Date between 12/1/2005 12:00:00 PM and 12/31/2005 11:59:59 PM. Any suggestions? -- Jim -- Jim You can use SUMPRODUCT =SUMPRODUCT((A1:A100>=B1)*(A1:A100<=B2)) A1:A100 ....date range B1 start date B2 end date HTH JG "jiml"...

Office Rebate Form
Where might I find the rebate form? There is a link in the newsletter which doesn't work. Is there another place to look for it? Thanks! Sorry, I have absolutely no idea what you are talking about! What rebate form? What newsletter? On 12/09/07 10:22 AM, in article 1189558341.483611.232980@x40g2000prg.googlegroups.com, "WildernessFlyFishers@gmail.com" <WildernessFlyFishers@gmail.com> wrote: > Where might I find the rebate form? There is a link in the newsletter > which doesn't work. Is there another place to look for it? > > Thanks! > -- Don&#...

Add Lookup Fields to Entity
I need to add 4 "technical contact" fields (which would lookup the Contact entity) to the CONTRACT form. Is this possible? I've found it difficult to figure out what to do first. Thanks in advance, Brandon Not possible. You cant have multiple lookups for the same entity. You also cannot create new relationships between two system entitites. This will work in 4.0 Not possible, Pezman. N:M relationships are not possible in 3.0 yet. There is a alternative solution: a new entity to act as an N:M relationship. In your case, Contract/Contact. This entity has two 1:N relations...

Excel Add Ins
What is the name of the template wizard with Data Tracking (Excel. I can not locate the add in template wizard with Data Tracking in Office 2003 Hi Richard You are not the only one<g> The Add-in is working in 2003 only the install file is not working. Copy the xla file from a PC with 2002 to the PC with 2003 and it will work(use Tools>add-ins to browse to the file in Excel) -- Regards Ron de Bruin http://www.rondebruin.nl "Richard" <Richard@discussions.microsoft.com> wrote in message news:193C5DFD-578D-48F7-B9D6-9FEF5BDCEB64@microsoft.com... > What is t...

form cell question in Ver2000
I have a large sheet with email addresses in a column that only displays "yes" with the letters in a gray shaded area. When I hover over the cell the underlying email address becomes visible. I need to find a way to create a column of the email addresses. Any help will be appreciated. James It sounds like someone added hyperlinks to your worksheet. If you select the cell and do Insert|Hyperlink, do you see the email address in a nice dialog? If yes, you can use a user defined function to extract that link (including email address). Saved from a previous post: One way to e...

Record Deleted
I am attempting to write a simple query and when I choose the information in ascending order I am receiving an error message that states a record has been deleted and will not provide the report. I'm finding that I'm receiving this message on several already created queries. How can I correct this without losing information? The only change has been the relocation of the file to another folder. Are you talking about the main .mdb file that's been moved? Is the database split? If so, have you relinked the tables after moving the file? Do you have full permissions to the fol...

add a row or column to a single cell in exel
I am trying to split a single cell into 2 rows can you help If I understood correctly you want to enter an entry in two lines in a cell at appropirate place hit lt+enter and again hit enter for e.g venkat (alt+enter) raman(enter) "trev" <trev@discussions.microsoft.com> wrote in message news:89B2C15C-057F-43B9-8282-37923D5EA397@microsoft.com... > I am trying to split a single cell into 2 rows can you help ...

Calling Forms
Usually when i write a Visual C++ program i use Dialogs insted of Forms. When i want to call a dialog i use the Dialog.DoModal(), but how can i call a Form? Ricardo Furtado wrote: > Usually when i write a Visual C++ program i use Dialogs insted of Forms. When > i want to call a dialog i use the Dialog.DoModal(), but how can i call a > Form? > If you have a document/view app, what is usually done is to switch the view from one formview to another, within the same frame window. Sample code is shown at: http://support.microsoft.com/default.aspx?scid=kb;en-us;141334 -- ...

Add on
Hello, Here is a scenerio. A client is buying 1lb of ham. It is put on a waxed paper then wrapped into a white paper and then put into a shopping bag. The usage of shopping bag is 100% cases the usage of paper is only with certin categories of sales. Same with the waxed paper. Question: Is there a way of associating wax paper, white paper and shopping bags in a way so with every sale a piece of paper gets deducted from inventory and one bag is deducted from inventory? I would like to run a report every so often and see if I need to purchase any supplies. Kits and assembly do not work...

View of Excel form is different on different computers.
A common form being shared on the network displays differently on different computers. We have varying versions of Office with different windows operating systems. The form views fine on the Windows 98 system with Excel 2000. All of the other systems are newer with Windows 2000 or XP using equal or newer versions of Excel. They show the form displayed with all of the columns squeezed together. Is there a way to make the form view the same on all computers regardless of operating system and Excel version? You've partially answered your own question - the more disparity between ...

Forcing borders of all columns when records less than max
Is there a way to force the 28 fields borders if there are less than 28 fields (28 columns is forced but borders do not show up when less than 28 records)? Can you explain what you are attempting to do? It isn't clear whether you mean 28 fields or 28 records or both. You can use the Line method to draw rectangles anywhere in your report. -- Duane Hookom Microsoft Access MVP "Michael" wrote: > Is there a way to force the 28 fields borders if there are less than 28 > fields (28 columns is forced but borders do not show up when less than 28 > records)? > ...

way to delete add. fr. auto. email add. function?
Is there a way to delete old or no longer used email addresses that appear in the drop down box when I am addressing a new email? Shebubba wrote: > Is there a way to delete old or no longer used email addresses that appear in > the drop down box when I am addressing a new email? That is the nickname cache. Search and delete the .nk2 file. That's the cache for nicknames (i.e., your manually entered e-mail addresses). If you only want to delete some of them, highlight an entry and hit the delete key. If that doesn't work, use Nirsoft's NK2 Viewer utility (it e...

POS 2009 Add-In: Populating a Task Pad
I would like to create a custom application that has the ability to maintain the items that are on certain Task Pads within POS 2009. These items would all be regular menu items (ex: hamburger, hot dog, french fries, etc) and not functions. For example, if a task pad was supposed to allow the cashier quick access to daily specials, then this custom application would need to be able to clear the task pad each day and add the items for that day. Is this going to be possible? Please provide some guidance. Thank you, Sean This is a multi-part message in MIME format. ------=_NextPart_00...

Add-in cannot be loaded OL07
Every time I open Outlook 2007 I get an error message regarding an add-in 'DCCExtensions' (DCCEXT32.DLL). It says the add-in cannot be loaded and has been disabled by Outlook. I've been getting this message ever since I uninstalled Winfax. How do I make this error stop appearing? Thanks. -- kapibarra Remove the addin from OL by using Trust Center, Addins. http://office.microsoft.com/en-us/outlook/HA100341271033.aspx#14 "kapibarra" wrote: > Every time I open Outlook 2007 I get an error > message regarding an add-in 'DCCExtensions' (DCCEXT32.DLL). ...

Format text to add character
I have two fields that should match, but one includes special characters while the other does not. Example: Field1 00ABCD123456123 Filed2 00/ABCD/123456/123/SBZ I need to find records where these two fields don't match, either by changing the display of one of them, or a query to compare Field1 character 7-15 with Field2 characters 9-14, 16-18. Hope this makes sense. Can anyone help? Thanks! Take a look at the following from the Access Help file it might be what you're looking for... Extract a part of a text value The following table lists examples of expressions that ...

Add File menu to custom toolbar
Hi All, I am trying to add the 'File" menu and "Window" menu of the Standard Toolbar to a custom toolbar but failing miserably! I think it should look something like: Sub AddMenuTitles() Application.CommandBars("MyCustomMenu").Controls.Add("File) Application.CommandBars("MyCustomMenu").Controls.Add("Window") End Sub Can anybody help please Regards Michael Sub test() AddMenuTitles True ' or false to delete End Sub Sub AddMenuTitles(bAdd As Boolean) Dim cbr As CommandBar Dim cbP As CommandBarPopup ...

Use Parameter Data to populate a form field
I am trying to figure out how to take the data I enter from a parameter query to populate a field on a form. Include the parameter(s) as a computed column(s) in the query, e.g. PARAMETERS [Enter start date:] DATETIME, [Enter end date:] DATETIME; SELECT SomeField, SomeOtherField, [Enter start date:] AS StartDate, [Enter end date:] AS EndDate FROM SomeTable WHERE DateField BETWEEN [Enter start date:] AND [Enter end date:]; In the above example you can then bind text box controls on the form to the StartDate and EndDate fields. Ken Sheridan Stafford, England JudyKemp w...

Quote Form
I am having a lot of difficulty doing modifications to the quote form beyond adding the company logo. I am using CRM 3.0, Outlook 2007, Word 2007. A couple of the issues are: 1) If disconnected from the domain (on laptop offline) can not connect to data source. 2) When on the network and select the quote table other fields indicate they are missing and Word wants to remove them. We are not interested in adding a 3rd party product and would really like to get this working with the tools provided in CRM. Has anybody had success with creating a nice custome quote form in Word, or am I wai...

add a DC in a LegSite
Hi, In the disaster recovery plan we want to create a leg site and put a DC in it. Here are some questions on how to achieve this smoothly. 1. Should I create the new site/subnet first and then promote a server in that subnet/site to DC, or should I promote a server in existing site/subnet and then move this DC to the new site/subnet? 2. When promoting a server to DC, should the server be a member server (already joined the domain) or just a workgroup member (no domain membership)? 3. The DC will be an AD-integrated DNS server. Should I install the DNS component (but not confi...

How can I add the customer's PO# to the drop-ship Purchase Order?
Our purchasing agent would like to be able to have the customers PO# from the Sales Transaction Entry screen show up on the PO's. Is this doable in Report Writer or can it not be done? We are using GP v9.0. As I still consider myself a newbie with RW, I would appreciate detailed instructions if possible. Thank you in advance for all responses. It is not possible thru traditional table relationships in Report Writer. Let me explain: you can certainly link the Purchase Order Work table to the SOP_POLink table and the SOP_POLink table to the SOP Transactions Work table, but will...

excel add-ons
Awhile back, there was an add-on for excel that had a lot more tools. It showed on the toolbar. Somehow I lost it and I would like to get it back. It had a lot of tools like for changing case and fill ins. Any help wouyld be great. Maybe ASAP Utilities. Try a 'net search for this add-in. Gord Dibben MS Excel MVP On Sun, 22 Mar 2009 20:22:43 -0400, "kmkx70a" <kmkx70a@prodigy.net> wrote: >Awhile back, there was an add-on for excel that had a lot more tools. It >showed on the toolbar. Somehow I lost it and I would like to get it back. It >had a lot of t...

Having OL automatically add a bcc: address
My boss wants to add me as a bcc: to every email she sends. Is there a way to set this up to happen automatically? Please reply to matt@lkigroup.com Thanks much. Matt ...

Map Add-On?
I am looking for an Excel Chart add on so that I can take numerical data and display it on a geographic map of states or zip codes for example. Even better I could color or shade a state based on the values in my spreadsheet. Any suggestions would be appreciated. Mark ...

Recording a marcro
Hi This is just a really simple one, to unprotect a worksheet. Having a problem. I'm going into Macros - Record - I select to save to Personal - choose as a shortcut ctrl u (for unprotect) - THEN - I go through the process of unprotecting the sheet, (even then click on a cell, just to add a final step) Then I go into Stop Recording. Well, when I click on the next sheet and hit ctrl u - I get the unprotect sheet window, that's as far as it goes. What am I doing wrong? (I go back in after this failure and delte the macro from Personal - to clear it out) ALSO - A SECOND QUESTION: ...

How do I scan in a form for entries and changes?
I have a 4 in 1 printer. How can I can in a blank form into my documents so that I can enter information into it. NOTE: I've tried to scan in the form but it gives me a jpeg (picture) format and I cannot make any modifications to it. For a one off, it is probably not worth the effort, but if you insert the jpeg so that it is behind the text, you can then type in front of it. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.co...