var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
I have a list box that list user name. When I double click one record I want to open the edit form corresponding to the record seleted. How will do it? Thanks for any help.
Theres a couple of ways that spring to mind.
The easiest would be hto have all the details about the record you want in the listbox, like name,id,1,2,3,4,5 and so on.
But under column widths you only show the name by changing sizes eg 2.5;0;0;0;0;0;0, make sure that the columncount is the same amount as the fields you have chosen.
Then under the properties of the combo box, double click you could run a loop to go through all the items and find the 1 that is selected.
For A = 0 To Me.listbox1.ListCount - 1
if Me.listbox1.Selected(A) = true then
'get your data here
the_name = Me.listbox1.Column(0, A)
the_id = Me.listbox1.Column(1, A)
the_1 = Me.listbox1.Column(2, A)
'open your form and populate with these details
Then on the new form, you could have a docmd.runsql to update,edit the records?
Thats one way of doing it, it also means that the user cannot go through any other records.
Does that help ??
Maybe that might have been hard to follow...
I have create this to help instead.
Thanks Ken. I will try it.
I tried the zip file you send, it works when the fields are unbound to a table. What I really wanted to do, I guess I did not explain it well, is to be able to get the data from the table for editing. For example if I double click the first data on the listbox it will open that data on the edit form just like the file you did but in a bound text that the data already exist on the table. I hope you could help me again.
if you open the first form and 'double click' a name, it should open a second form with the data from the table.
then if you edit anything there and press the 'save button' it will update the table with those changes.
Is that not what you wanted ?
Thanks for all the help. It works.