Control using a Listbox

  • Thread starter Thread starter s4
  • Start date Start date
S

s4

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
 
The wizard doesn't build the criteria. You need to build it. Open the code
module and provide a value for stLinkCriteria.
 
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
 
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.
 
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
 
Thanks I'll give it a go.
So that's like docmd.opendform "form1",,,"[date] = "& me.list0"

Thanks
 
Too many quotes.

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


s4 said:
Thanks I'll give it a go.
So that's like docmd.opendform "form1",,,"[date] = "& me.list0"

Thanks

Pat Hartman said:
DoCmd.OpenForm "yourformname",,,"RecordKey = " &
Me.RecordKeyFromFormField
 
Back
Top