Update Record

F

fi.or.jp.de

Hi All,

I have created UserForm in Excel and added button which will search
all the records in Access database and get the results in a Excel
userform listbox.

I dont have any problem in searching and updating the data into Access
Database.

The main problem is - Assume I have two textbox in userform 1. Name 2.
Dept

Using search option i will get the results in a listbox.

Suppose user wants to change his dept then user selects particular
name in a listbox and will
change the name.
if user updates the changes in my database I can see old data and the
new data.

I want only the new data.

Is this possible,

Please help me !

Thanks in advance
 
J

joel

use a combobox instead of list box. It works the same except the combobox
allows a manual entry.
 
P

Patrick Molloy

hoe is the database refreshed with changed data? seems to me that one way
would be to re-populate the list boxes
 
F

fi.or.jp.de

Yes I agree, but old record in my database remain, I dont want that
old data once it is updated.
 
J

joel

You need to use a combobox, but you can also have a routine that after a new
entry is entered that would remove the old entry(s) that you want to remove.
Use a combobox ONChange function to remove older entries. Kepp a copy of the
old values hidden so you can figure out the new entry. One trick is to have
a hidden box on the userform that keeps the old values. Then compare the
hidden box to the visible box to figure out the new value that is added. so
you would have Combobox1.visible = true and combobox2.visible = false.
 

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