PC Review


Reply
Thread Tools Rate Thread

Control using a Listbox

 
 
s4
Guest
Posts: n/a
 
      11th Jan 2008
Hey, I have a form of records, and a listbox with all of the dates from said
records.
Anyone know a way to select one of the dates in the listbox and click a
button to edit that record. I've tried findrecord and openform with that date
as a filter but I always just get the first record shown.
Also I have a report and was wondering if you knew how to make the selected
record in the same listbox the last record displayed in the report, sort of
like printing the week ending.
Thanks
 
Reply With Quote
 
 
 
 
Pat Hartman
Guest
Posts: n/a
 
      11th Jan 2008
The wizard doesn't build the criteria. You need to build it. Open the code
module and provide a value for stLinkCriteria.

"s4" <(E-Mail Removed)> wrote in message
news:CA5F12F9-ABCC-486F-8E18-(E-Mail Removed)...
> Hey, I have a form of records, and a listbox with all of the dates from
> said
> records.
> Anyone know a way to select one of the dates in the listbox and click a
> button to edit that record. I've tried findrecord and openform with that
> date
> as a filter but I always just get the first record shown.
> Also I have a report and was wondering if you knew how to make the
> selected
> record in the same listbox the last record displayed in the report, sort
> of
> like printing the week ending.
> Thanks



 
Reply With Quote
 
s4
Guest
Posts: n/a
 
      11th Jan 2008
I've tried that, but I only get the first record, I think it might be
something to do with the selected property. Anyone know how to refer to the
record that's selected?
I've tried docmd.openform , , , datefb = me.list20 but I get the above result.
Thanks

"Pat Hartman" wrote:

> The wizard doesn't build the criteria. You need to build it. Open the code
> module and provide a value for stLinkCriteria.
>
> "s4" <(E-Mail Removed)> wrote in message
> news:CA5F12F9-ABCC-486F-8E18-(E-Mail Removed)...
> > Hey, I have a form of records, and a listbox with all of the dates from
> > said
> > records.
> > Anyone know a way to select one of the dates in the listbox and click a
> > button to edit that record. I've tried findrecord and openform with that
> > date
> > as a filter but I always just get the first record shown.
> > Also I have a report and was wondering if you knew how to make the
> > selected
> > record in the same listbox the last record displayed in the report, sort
> > of
> > like printing the week ending.
> > Thanks

>
>
>

 
Reply With Quote
 
Dale Fye
Guest
Posts: n/a
 
      11th Jan 2008
What does the MultiSelect property of the listbox have int it (None, Simple,
Extended). If it is anything other than "None", then you cannot get the
"value" of the item that is selected using the listboxes Value property. You
will have to loop through the listboxes ItemsSelected collection and identify
the values, something like:

For each varItem in me.lst_myList.ItemsSelected
debug.print me.lst_myList.column(0, varItem)
Next

HTH
Dale

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"s4" wrote:

> I've tried that, but I only get the first record, I think it might be
> something to do with the selected property. Anyone know how to refer to the
> record that's selected?
> I've tried docmd.openform , , , datefb = me.list20 but I get the above result.
> Thanks
>
> "Pat Hartman" wrote:
>
> > The wizard doesn't build the criteria. You need to build it. Open the code
> > module and provide a value for stLinkCriteria.
> >
> > "s4" <(E-Mail Removed)> wrote in message
> > news:CA5F12F9-ABCC-486F-8E18-(E-Mail Removed)...
> > > Hey, I have a form of records, and a listbox with all of the dates from
> > > said
> > > records.
> > > Anyone know a way to select one of the dates in the listbox and click a
> > > button to edit that record. I've tried findrecord and openform with that
> > > date
> > > as a filter but I always just get the first record shown.
> > > Also I have a report and was wondering if you knew how to make the
> > > selected
> > > record in the same listbox the last record displayed in the report, sort
> > > of
> > > like printing the week ending.
> > > Thanks

> >
> >
> >

 
Reply With Quote
 
s4
Guest
Posts: n/a
 
      13th Jan 2008
It's none. You can only select one item.
Would you be able to give me an example of code to display the selected
record please?
Thanks

"Dale Fye" wrote:

> What does the MultiSelect property of the listbox have int it (None, Simple,
> Extended). If it is anything other than "None", then you cannot get the
> "value" of the item that is selected using the listboxes Value property. You
> will have to loop through the listboxes ItemsSelected collection and identify
> the values, something like:
>
> For each varItem in me.lst_myList.ItemsSelected
> debug.print me.lst_myList.column(0, varItem)
> Next
>
> HTH
> Dale
>
> --
> Don''t forget to rate the post if it was helpful!
>
> email address is invalid
> Please reply to newsgroup only.
>
>
>
> "s4" wrote:
>
> > I've tried that, but I only get the first record, I think it might be
> > something to do with the selected property. Anyone know how to refer to the
> > record that's selected?
> > I've tried docmd.openform , , , datefb = me.list20 but I get the above result.
> > Thanks
> >
> > "Pat Hartman" wrote:
> >
> > > The wizard doesn't build the criteria. You need to build it. Open the code
> > > module and provide a value for stLinkCriteria.
> > >
> > > "s4" <(E-Mail Removed)> wrote in message
> > > news:CA5F12F9-ABCC-486F-8E18-(E-Mail Removed)...
> > > > Hey, I have a form of records, and a listbox with all of the dates from
> > > > said
> > > > records.
> > > > Anyone know a way to select one of the dates in the listbox and click a
> > > > button to edit that record. I've tried findrecord and openform with that
> > > > date
> > > > as a filter but I always just get the first record shown.
> > > > Also I have a report and was wondering if you knew how to make the
> > > > selected
> > > > record in the same listbox the last record displayed in the report, sort
> > > > of
> > > > like printing the week ending.
> > > > Thanks
> > >
> > >
> > >

 
Reply With Quote
 
Pat Hartman
Guest
Posts: n/a
 
      14th Jan 2008
DoCmd.OpenForm "yourformname",,,"RecordKey = " & Me.RecordKeyFromFormField

"s4" <(E-Mail Removed)> wrote in message
news:3C49F232-3636-450A-A7E9-(E-Mail Removed)...
> It's none. You can only select one item.
> Would you be able to give me an example of code to display the selected
> record please?
> Thanks
>
> "Dale Fye" wrote:
>
>> What does the MultiSelect property of the listbox have int it (None,
>> Simple,
>> Extended). If it is anything other than "None", then you cannot get the
>> "value" of the item that is selected using the listboxes Value property.
>> You
>> will have to loop through the listboxes ItemsSelected collection and
>> identify
>> the values, something like:
>>
>> For each varItem in me.lst_myList.ItemsSelected
>> debug.print me.lst_myList.column(0, varItem)
>> Next
>>
>> HTH
>> Dale
>>
>> --
>> Don''t forget to rate the post if it was helpful!
>>
>> email address is invalid
>> Please reply to newsgroup only.
>>
>>
>>
>> "s4" wrote:
>>
>> > I've tried that, but I only get the first record, I think it might be
>> > something to do with the selected property. Anyone know how to refer to
>> > the
>> > record that's selected?
>> > I've tried docmd.openform , , , datefb = me.list20 but I get the above
>> > result.
>> > Thanks
>> >
>> > "Pat Hartman" wrote:
>> >
>> > > The wizard doesn't build the criteria. You need to build it. Open
>> > > the code
>> > > module and provide a value for stLinkCriteria.
>> > >
>> > > "s4" <(E-Mail Removed)> wrote in message
>> > > news:CA5F12F9-ABCC-486F-8E18-(E-Mail Removed)...
>> > > > Hey, I have a form of records, and a listbox with all of the dates
>> > > > from
>> > > > said
>> > > > records.
>> > > > Anyone know a way to select one of the dates in the listbox and
>> > > > click a
>> > > > button to edit that record. I've tried findrecord and openform with
>> > > > that
>> > > > date
>> > > > as a filter but I always just get the first record shown.
>> > > > Also I have a report and was wondering if you knew how to make the
>> > > > selected
>> > > > record in the same listbox the last record displayed in the report,
>> > > > sort
>> > > > of
>> > > > like printing the week ending.
>> > > > Thanks
>> > >
>> > >
>> > >



 
Reply With Quote
 
s4
Guest
Posts: n/a
 
      14th Jan 2008
Thanks I'll give it a go.
So that's like docmd.opendform "form1",,,"[date] = "& me.list0"

Thanks

"Pat Hartman" wrote:

> DoCmd.OpenForm "yourformname",,,"RecordKey = " & Me.RecordKeyFromFormField
>
> "s4" <(E-Mail Removed)> wrote in message
> news:3C49F232-3636-450A-A7E9-(E-Mail Removed)...
> > It's none. You can only select one item.
> > Would you be able to give me an example of code to display the selected
> > record please?
> > Thanks
> >
> > "Dale Fye" wrote:
> >
> >> What does the MultiSelect property of the listbox have int it (None,
> >> Simple,
> >> Extended). If it is anything other than "None", then you cannot get the
> >> "value" of the item that is selected using the listboxes Value property.
> >> You
> >> will have to loop through the listboxes ItemsSelected collection and
> >> identify
> >> the values, something like:
> >>
> >> For each varItem in me.lst_myList.ItemsSelected
> >> debug.print me.lst_myList.column(0, varItem)
> >> Next
> >>
> >> HTH
> >> Dale
> >>
> >> --
> >> Don''t forget to rate the post if it was helpful!
> >>
> >> email address is invalid
> >> Please reply to newsgroup only.
> >>
> >>
> >>
> >> "s4" wrote:
> >>
> >> > I've tried that, but I only get the first record, I think it might be
> >> > something to do with the selected property. Anyone know how to refer to
> >> > the
> >> > record that's selected?
> >> > I've tried docmd.openform , , , datefb = me.list20 but I get the above
> >> > result.
> >> > Thanks
> >> >
> >> > "Pat Hartman" wrote:
> >> >
> >> > > The wizard doesn't build the criteria. You need to build it. Open
> >> > > the code
> >> > > module and provide a value for stLinkCriteria.
> >> > >
> >> > > "s4" <(E-Mail Removed)> wrote in message
> >> > > news:CA5F12F9-ABCC-486F-8E18-(E-Mail Removed)...
> >> > > > Hey, I have a form of records, and a listbox with all of the dates
> >> > > > from
> >> > > > said
> >> > > > records.
> >> > > > Anyone know a way to select one of the dates in the listbox and
> >> > > > click a
> >> > > > button to edit that record. I've tried findrecord and openform with
> >> > > > that
> >> > > > date
> >> > > > as a filter but I always just get the first record shown.
> >> > > > Also I have a report and was wondering if you knew how to make the
> >> > > > selected
> >> > > > record in the same listbox the last record displayed in the report,
> >> > > > sort
> >> > > > of
> >> > > > like printing the week ending.
> >> > > > Thanks
> >> > >
> >> > >
> >> > >

>
>
>

 
Reply With Quote
 
Pat Hartman
Guest
Posts: n/a
 
      14th Jan 2008
Too many quotes.

docmd.opendform "form1",,,"[date] = "& me.list0


"s4" <(E-Mail Removed)> wrote in message
news:CF25A351-3CCC-4D58-BF98-(E-Mail Removed)...
> Thanks I'll give it a go.
> So that's like docmd.opendform "form1",,,"[date] = "& me.list0"
>
> Thanks
>
> "Pat Hartman" wrote:
>
>> DoCmd.OpenForm "yourformname",,,"RecordKey = " &
>> Me.RecordKeyFromFormField
>>
>> "s4" <(E-Mail Removed)> wrote in message
>> news:3C49F232-3636-450A-A7E9-(E-Mail Removed)...
>> > It's none. You can only select one item.
>> > Would you be able to give me an example of code to display the selected
>> > record please?
>> > Thanks
>> >
>> > "Dale Fye" wrote:
>> >
>> >> What does the MultiSelect property of the listbox have int it (None,
>> >> Simple,
>> >> Extended). If it is anything other than "None", then you cannot get
>> >> the
>> >> "value" of the item that is selected using the listboxes Value
>> >> property.
>> >> You
>> >> will have to loop through the listboxes ItemsSelected collection and
>> >> identify
>> >> the values, something like:
>> >>
>> >> For each varItem in me.lst_myList.ItemsSelected
>> >> debug.print me.lst_myList.column(0, varItem)
>> >> Next
>> >>
>> >> HTH
>> >> Dale
>> >>
>> >> --
>> >> Don''t forget to rate the post if it was helpful!
>> >>
>> >> email address is invalid
>> >> Please reply to newsgroup only.
>> >>
>> >>
>> >>
>> >> "s4" wrote:
>> >>
>> >> > I've tried that, but I only get the first record, I think it might
>> >> > be
>> >> > something to do with the selected property. Anyone know how to refer
>> >> > to
>> >> > the
>> >> > record that's selected?
>> >> > I've tried docmd.openform , , , datefb = me.list20 but I get the
>> >> > above
>> >> > result.
>> >> > Thanks
>> >> >
>> >> > "Pat Hartman" wrote:
>> >> >
>> >> > > The wizard doesn't build the criteria. You need to build it.
>> >> > > Open
>> >> > > the code
>> >> > > module and provide a value for stLinkCriteria.
>> >> > >
>> >> > > "s4" <(E-Mail Removed)> wrote in message
>> >> > > news:CA5F12F9-ABCC-486F-8E18-(E-Mail Removed)...
>> >> > > > Hey, I have a form of records, and a listbox with all of the
>> >> > > > dates
>> >> > > > from
>> >> > > > said
>> >> > > > records.
>> >> > > > Anyone know a way to select one of the dates in the listbox and
>> >> > > > click a
>> >> > > > button to edit that record. I've tried findrecord and openform
>> >> > > > with
>> >> > > > that
>> >> > > > date
>> >> > > > as a filter but I always just get the first record shown.
>> >> > > > Also I have a report and was wondering if you knew how to make
>> >> > > > the
>> >> > > > selected
>> >> > > > record in the same listbox the last record displayed in the
>> >> > > > report,
>> >> > > > sort
>> >> > > > of
>> >> > > > like printing the week ending.
>> >> > > > Thanks
>> >> > >
>> >> > >
>> >> > >

>>
>>
>>



 
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
Listbox to control listbox NDClark Microsoft Access 9 27th Feb 2010 04:44 PM
Move record selected in Listbox to top of listbox control =?Utf-8?B?SG9sbHk=?= Microsoft Access Forms 8 25th Aug 2006 02:13 PM
Why my ListBox Control in my Web Control is not Raising the SelectedIndexChanged Event ? msnews.microsoft.com Microsoft ASP .NET 6 28th Apr 2005 06:44 PM
[?] Listbox Control DwayneConyers Microsoft Access Forms 2 25th Jan 2005 03:26 PM
returning the selected value of a listbox control inside a user control - please urgent! Moe Sizlak Microsoft ASP .NET 4 20th Jul 2004 11:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:54 AM.