Listbox question

referee

Registered User.
Local time
Today, 10:08
Joined
Aug 21, 2003
Messages
38
Hi all,

on my form i have a listbox with 7 columns
now when i click on it i want the data from the listbox to Fields on the form

when that data is on the form and i have click another row in the listbox and de data is different from the data in the form i have want to a message that's tells me that
something like:
msgbox" you have selected another person, do you want replace this on the form"

now when the person that is selected in the listbox is it possible to hide it in de listbox?
can someone help me with thid code please

THANKS
 
short answer -> no
long answer -> you could but you'd need a requery... not worth it

If the first field on the list box is a) not hidden and b) not the unique id (PK) field then you need to look at this first.

Once you have the unique id as the first column, you can select it with the mouse. On the on_click event, check the value of the id against a form (scoped) variable which holds the last selected id. If they are the same, then exit. If the last id viewed was -1 (the default set up as the form opens) then you just fill the fields/textboxes with data. If however the id is something else... Well then you message box, asking the user. If they cancel, you reset the list box to the correct selected row, and exit If they say yes though, you refill in the textboxes.


Vince
 

Users who are viewing this thread

Back
Top Bottom