PDA

View Full Version : Edit form with combobox


paulafernandes
12-09-2002, 04:50 PM
Hi! I have another question for you, I hope I'm not to annoying...

This is my situation:

I have a combobox filled with the content of a table. The combobox stores the code and shows the name.

I already did the form that does the INSERT.
Now I want to do a form so the user can edit the data.

I want to show in the combobox (value selected) the value stored in the database, but also all the content of the table, so the user can (if he want's to) choose another name.

I hope that my explanation is not to confuse....

Thank's!
Paula

whammy
12-10-2002, 06:21 AM
Your explanation was a bit confusing to me... do you have an example? Especially regarding what isn't working?

codefox
12-10-2002, 09:31 AM
I guess you are displaying the fields in a form and allow the user to browse thru it and edit any record. Is that right? If so, what is the problem? :)

paulafernandes
12-10-2002, 11:37 AM
Ok, I'll try to explain with an example:

I have a table 'employee' and a table called 'local'.

On the insert form, the user choose a local to a employee from a combobox wich was filled with table 'local' and the code was saved on table 'employee'.

Now I want to do the edit form. I need to have the same combobox, but instead of the default value selected, I want to appear the item that is saved on the database. But the combobox needs to be filled with the table 'local' so the user can choose another item if he want's to.

So, I need to search the code of the local on table 'employee' and show the correspondent value of the table 'local' on the combobox. Easy. I need to fill the combobox with the content of table 'local'. Easy.
But how I combine the two?
I think I need to use two recordsets, but is there a better way?

I don't know if I explain it, or confused it even more!

Paula