Solved Double click list box to populate form fields (1 Viewer)

Ihk

Member
Local time
Today, 22:39
Joined
Apr 7, 2020
Messages
280
1) I have form for data entry (data entry = yes), so it creates new ID on new records. (to create new orders)
2) this form has listbox, for search purposes if the records were already entered in database table. So double click (list box specefic record) will populate form with exactly same data on the form (except the ID field, it will be new).
Problem: a) I can not link with ID, it will act as new entry. b) if column width of a field is zero, then column number also wont work.
Little explanation:
It was working perfectly fine by (example)
Code:
Forms!Form1.Field1.Value = Me.ListboxName.Column(4)
But this does not work for those fields whose column width in listbox is zero (for example Foriegen keys). But I must want to populate in the form.
Basically at first orders are created at 1st, afterwards time comes, when same orders (with same details) have to be re-ordered. So list box serve as search function, and double click will serve to autopopulate to make re-order process quick. Because it will act as new order, new ID so I can not link fields ID basis.
Lisbox source is query.
 

Ihk

Member
Local time
Today, 22:39
Joined
Apr 7, 2020
Messages
280
I solved this by column number method...............
If some one has different idea, will be happy to see that... thank you.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:39
Joined
May 7, 2009
Messages
19,169
But this does not work for those fields whose column width in listbox is zero
why wouldn't it populate?
 

Ihk

Member
Local time
Today, 22:39
Joined
Apr 7, 2020
Messages
280
why wouldn't it populate?
I was wrong, it was only ID field -- if it has zero width then I should not count this as column, while other than ID columns whether those have zero width or not, should be counted in column number. it is working now. thank you.
 

Users who are viewing this thread

Top Bottom