Selection from listbox into textbox on other form

MvP14

Registered User.
Local time
Today, 22:18
Joined
Apr 15, 2003
Messages
66
Hi,

I have the following problem: I have a search form that searches a table which is composed of various tables of other databases (built with append queries).

Because the table is composed of different tables (of different people), their keywords may vary (basic list which can be updated by each individual user). Therefore, I have also built a table with keywords composed of all the keywords used by the different individuals. The table is opened in a pop up form by a button on the search form.

What I would like to happen, is that when a keyword is double clicked, it is entered in the relevant textbox on the search form. If there were only one possible textbox where it would have to appear, I would have no problem.

However, it is possible to use 5 different criteria on the search form (5 comboboxes, which contains the different fields of the table). When a control is chosen in a combobox, the corresponding textbox is set to available.

How can I make have the double clicked keyword end up in the last textbox that had the focus on the search form before the keywords button was pressed?
 
Have you tried looking at the PreviousControl property eg

on the double click property of the keyword control

Screen.PreviousControl.Value = Me.ActiveControl.Value

This strips the value from the control you have double clicked and places it into the previous control.

Careful though, you must make sure that the control you want to copy the data to is compatible and also that the control you double click on is not the first to take the focus on the form.
 

Users who are viewing this thread

Back
Top Bottom