DblClick to Pick a Record from Datasheet/Table

E

erotisi

Hi to all,

I have created a form with comboboxes and everything works fine.
When you doubleclick in a combobox the corresponding table or Datasheet form
with the rows of values opens in a new window.

How can by doubleclicking on any of these rows to have the value returned in
the combobox?

Ex: 1. Combobox for Customers.
2. DblClick in the Combobox and the Customer Tables opens ( or a datasheet
form I 've made opens) .
3. How can I pick by dblclick on a row of the open table and return he
customer back in my combo?

Thanx
Tsp
 
A

Albert D. Kallal

erotisi said:
Hi to all,

I have created a form with comboboxes and everything works fine.
When you doubleclick in a combobox the corresponding table or Datasheet
form
with the rows of values opens in a new window.

How can by doubleclicking on any of these rows to have the value returned
in
the combobox?

Ex: 1. Combobox for Customers.
2. DblClick in the Combobox and the Customer Tables opens ( or a datasheet
form I 've made opens) .

The above process seems a bit strange that you double clicking on a combo
box to display a list of customers? does not the combo box already have a
customer list that you display when you click and open up a combo box? I was
thinking that you could double click on the combo box and thus open up a
form to edit the customer currenlty selected in the combo box.

For some reason you seem to want to be able to do the reverse process?
3. How can I pick by dblclick on a row of the open table and return he
customer back in my combo?

You'd have to use continuous form, and when the user double clicks on a
field in this new form, you simply use the double click event of that
control, and stuff the value of the customer id back into the combo box.

forms!nameOfFormWithComboBox!NameOfCombobox = me!ID

You could also consider putting the above line code in the close event of
this form (but, that would not allow you to have a cancel ability).

For the most part I would've thought the interface works the other way
around: You select a customer in the combo box, then double click of a combo
box, and you open up a the customer form that lets you view/edit the
customer. It really doesn't seem to make sense to select a customer in a
form, that sets a combo box and that combo box already has a "list" of
customers in it that you could have selected by simply dropping down the
combo box. Why open up a form here???

Anyway the above code is how you can set the value of a control in a
different form from the one you are in...
 
E

erotisi via AccessMonster.com

Albert thanx for your answer,

Suppose that the combo looks at a table with 3000 customers, so its
impossible to scroll down the list to pick up a customer.
Also you may want to search the customer list with various criteria until you
find which customer to pick. I thought the best way is to pop-up in a window
(form) the customer list by doubleclicking the combo, so as the user can
search the list and pick the customer.

Thanx again
Hi to all,
[quoted text clipped - 10 lines]
2. DblClick in the Combobox and the Customer Tables opens ( or a datasheet
form I 've made opens) .

The above process seems a bit strange that you double clicking on a combo
box to display a list of customers? does not the combo box already have a
customer list that you display when you click and open up a combo box? I was
thinking that you could double click on the combo box and thus open up a
form to edit the customer currenlty selected in the combo box.

For some reason you seem to want to be able to do the reverse process?
3. How can I pick by dblclick on a row of the open table and return he
customer back in my combo?

You'd have to use continuous form, and when the user double clicks on a
field in this new form, you simply use the double click event of that
control, and stuff the value of the customer id back into the combo box.

forms!nameOfFormWithComboBox!NameOfCombobox = me!ID

You could also consider putting the above line code in the close event of
this form (but, that would not allow you to have a cancel ability).

For the most part I would've thought the interface works the other way
around: You select a customer in the combo box, then double click of a combo
box, and you open up a the customer form that lets you view/edit the
customer. It really doesn't seem to make sense to select a customer in a
form, that sets a combo box and that combo box already has a "list" of
customers in it that you could have selected by simply dropping down the
combo box. Why open up a form here???

Anyway the above code is how you can set the value of a control in a
different form from the one you are in...
 
N

nomadk

I think Albert's right, using a combobox doesn't make a whole lotta sense in
this case. I'd use a text box and leither aunch your popup form with its On
Click event or add a button to launch it. Either way, Albert's code will set
the value you need.

erotisi via AccessMonster.com said:
Albert thanx for your answer,

Suppose that the combo looks at a table with 3000 customers, so its
impossible to scroll down the list to pick up a customer.
Also you may want to search the customer list with various criteria until you
find which customer to pick. I thought the best way is to pop-up in a window
(form) the customer list by doubleclicking the combo, so as the user can
search the list and pick the customer.

Thanx again
Hi to all,
[quoted text clipped - 10 lines]
2. DblClick in the Combobox and the Customer Tables opens ( or a datasheet
form I 've made opens) .

The above process seems a bit strange that you double clicking on a combo
box to display a list of customers? does not the combo box already have a
customer list that you display when you click and open up a combo box? I was
thinking that you could double click on the combo box and thus open up a
form to edit the customer currenlty selected in the combo box.

For some reason you seem to want to be able to do the reverse process?
3. How can I pick by dblclick on a row of the open table and return he
customer back in my combo?

You'd have to use continuous form, and when the user double clicks on a
field in this new form, you simply use the double click event of that
control, and stuff the value of the customer id back into the combo box.

forms!nameOfFormWithComboBox!NameOfCombobox = me!ID

You could also consider putting the above line code in the close event of
this form (but, that would not allow you to have a cancel ability).

For the most part I would've thought the interface works the other way
around: You select a customer in the combo box, then double click of a combo
box, and you open up a the customer form that lets you view/edit the
customer. It really doesn't seem to make sense to select a customer in a
form, that sets a combo box and that combo box already has a "list" of
customers in it that you could have selected by simply dropping down the
combo box. Why open up a form here???

Anyway the above code is how you can set the value of a control in a
different form from the one you are in...
 
E

erotisi via AccessMonster.com

In that sense you are both right.

The solution worked....

Thanxs again


I think Albert's right, using a combobox doesn't make a whole lotta sense in
this case. I'd use a text box and leither aunch your popup form with its On
Click event or add a button to launch it. Either way, Albert's code will set
the value you need.
Albert thanx for your answer,
[quoted text clipped - 43 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top