PC Review


Reply
Thread Tools Rate Thread

List Box with Record Count

 
 
Nigel
Guest
Posts: n/a
 
      8th Jul 2008
I am looking to create a list box on a form with a record count in it, the
format is

1 of 3
2 of 3
3 of 3

etc based on the number of record being retruned

also the user should be able to select an item from the list box and that
row should be selected
 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      8th Jul 2008
Hi,
something like this

RecCount=me.recordsetclone.recordcount
for i= 1 to RecCount
MyListBox.AddItem Item:=i & " of " & RecCount
next i


--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com

"Nigel" <(E-Mail Removed)> wrote in message
news:FC79E251-D133-4F34-A859-(E-Mail Removed)...
>I am looking to create a list box on a form with a record count in it, the
> format is
>
> 1 of 3
> 2 of 3
> 3 of 3
>
> etc based on the number of record being retruned
>
> also the user should be able to select an item from the list box and that
> row should be selected


 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      8th Jul 2008
Alex,

where would I put the code?



"Alex Dybenko" wrote:

> Hi,
> something like this
>
> RecCount=me.recordsetclone.recordcount
> for i= 1 to RecCount
> MyListBox.AddItem Item:=i & " of " & RecCount
> next i
>
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://accessblog.net
> http://www.PointLtd.com
>
> "Nigel" <(E-Mail Removed)> wrote in message
> news:FC79E251-D133-4F34-A859-(E-Mail Removed)...
> >I am looking to create a list box on a form with a record count in it, the
> > format is
> >
> > 1 of 3
> > 2 of 3
> > 3 of 3
> >
> > etc based on the number of record being retruned
> >
> > also the user should be able to select an item from the list box and that
> > row should be selected

>
>

 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      8th Jul 2008

OK that was just plain dumb by me,

but now I need it to go to the selected record so if I select 2 of 2 then it
should go to that record

"Alex Dybenko" wrote:

> Hi,
> something like this
>
> RecCount=me.recordsetclone.recordcount
> for i= 1 to RecCount
> MyListBox.AddItem Item:=i & " of " & RecCount
> next i
>
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://accessblog.net
> http://www.PointLtd.com
>
> "Nigel" <(E-Mail Removed)> wrote in message
> news:FC79E251-D133-4F34-A859-(E-Mail Removed)...
> >I am looking to create a list box on a form with a record count in it, the
> > format is
> >
> > 1 of 3
> > 2 of 3
> > 3 of 3
> >
> > etc based on the number of record being retruned
> >
> > also the user should be able to select an item from the list box and that
> > row should be selected

>
>

 
Reply With Quote
 
Alex Dybenko
Guest
Posts: n/a
 
      8th Jul 2008
something like this:

set rst= me.recordsetclone
rst.movefirst
for i = 1 to left(MyListBox,1)
rst.movenext
next i
me.bookmark=rst.bookmark

of course you also need to add code that will prevent possible errors

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


"Nigel" <(E-Mail Removed)> wrote in message
news:28AF1BE1-68E7-4336-B91D-(E-Mail Removed)...
>
> OK that was just plain dumb by me,
>
> but now I need it to go to the selected record so if I select 2 of 2 then
> it
> should go to that record
>
> "Alex Dybenko" wrote:
>
>> Hi,
>> something like this
>>
>> RecCount=me.recordsetclone.recordcount
>> for i= 1 to RecCount
>> MyListBox.AddItem Item:=i & " of " & RecCount
>> next i
>>
>>
>> --
>> Best regards,
>> ___________
>> Alex Dybenko (MVP)
>> http://accessblog.net
>> http://www.PointLtd.com
>>
>> "Nigel" <(E-Mail Removed)> wrote in message
>> news:FC79E251-D133-4F34-A859-(E-Mail Removed)...
>> >I am looking to create a list box on a form with a record count in it,
>> >the
>> > format is
>> >
>> > 1 of 3
>> > 2 of 3
>> > 3 of 3
>> >
>> > etc based on the number of record being retruned
>> >
>> > also the user should be able to select an item from the list box and
>> > that
>> > row should be selected

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
List Box Record Count Martin Microsoft Access VBA Modules 2 21st Apr 2009 04:16 PM
Count New to the List, Count Leaving the List, Count Total SteveC Microsoft Excel Misc 1 2nd Feb 2009 10:48 PM
Re: Count that will display the number for each record in the count increment. Sylvain Lafontaine Microsoft Access ADP SQL Server 0 12th Jul 2008 05:25 PM
I need a record count of individual categories from a list box msimons Microsoft Access Reports 1 9th Apr 2008 12:10 AM
Current Record Count, Previous Record #, Add New Record =?Utf-8?B?Um9iZXJ0IE51c3ogQCBEUFM=?= Microsoft Access Forms 0 15th Feb 2005 09:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:06 PM.