Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Control using a Listbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
s4 - 11 Jan 2008 13:09 GMT
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
Pat Hartman - 11 Jan 2008 14:52 GMT
The wizard doesn't build the criteria.  You need to build it.  Open the code
module and provide a value for stLinkCriteria.

> Hey, I have a form of records, and a listbox with all of the dates from
> said
[quoted text clipped - 9 lines]
> like printing the week ending.
> Thanks
s4 - 11 Jan 2008 15:12 GMT
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

> The wizard doesn't build the criteria.  You need to build it.  Open the code
> module and provide a value for stLinkCriteria.
[quoted text clipped - 12 lines]
> > like printing the week ending.
> > Thanks
Dale Fye - 11 Jan 2008 19:09 GMT
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

Signature

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

email address is invalid
Please reply to newsgroup only.

> 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
[quoted text clipped - 18 lines]
> > > like printing the week ending.
> > > Thanks
s4 - 13 Jan 2008 17:41 GMT
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

> 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
[quoted text clipped - 31 lines]
> > > > like printing the week ending.
> > > > Thanks
Pat Hartman - 14 Jan 2008 14:44 GMT
DoCmd.OpenForm "yourformname",,,"RecordKey = " & Me.RecordKeyFromFormField

> It's none. You can only select one item.
> Would you be able to give me an example of code to display the selected
[quoted text clipped - 46 lines]
>> > > > like printing the week ending.
>> > > > Thanks
s4 - 14 Jan 2008 14:56 GMT
Thanks I'll give it a go.
So that's like docmd.opendform "form1",,,"[date] = "& me.list0"

Thanks

> DoCmd.OpenForm "yourformname",,,"RecordKey = " & Me.RecordKeyFromFormField
>
[quoted text clipped - 48 lines]
> >> > > > like printing the week ending.
> >> > > > Thanks
Pat Hartman - 14 Jan 2008 21:39 GMT
Too many quotes.

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

> Thanks I'll give it a go.
> So that's like docmd.opendform "form1",,,"[date] = "& me.list0"
[quoted text clipped - 64 lines]
>> >> > > > like printing the week ending.
>> >> > > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.