I use
dim mydb as recordset
and also use
mydb.update
in certain required places like the update command button clicking. It works, by adding the new value in database. I have a list that shows the values of that db. But the main problem is i cannot see the newly added values unless i exit and reopen the application. after reopen i can see the newly added value. But i want to see the value in run time after clicking the add button which add value from a text box that i write. Sorry for the long literature, please help me.

try list1.refresh after the updating part,

but sometimes this does not work.
Best way,after updating,close the connection then open it again,ok?

Try mydb.requery as well

As i am not so expert, would u please tell me what should be the code example of closing connection?

What is the type of connection that you are using.

if u r using the DAO technique use the table recordset type at the time of opening the recordset. a sample is :-

dim db as database,rs as recordset

set db=opendatabase(app.path & "\mydb.mdb")
set rs=db.openrecordset("table1",dbopentable)
if rs.recordcount>0 then
''ur data showing code goes here
endif

otherwise u have to simultaneously unload and show up ur forms.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.