datagrid  + vb

bkanthavelms used Ask the Experts™
i need help

       * I am using msaccess vb with msaccess
and I am using datagrid

       My ques is how can I add more more one record at a time without update in database. ie.when i click save button then that the more than one record will update to database.

waiting for ur rep

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

they why not use a temporary table. you could replicate your original table, then on save simply move all records from your temp table to your original table.

i use this most of the time.


How can i add more than one record in datagrid with vb
and ms access
waiting for ur rep

simply add your record to your recordset. then after adding, refresh your grid by datagrid.refresh

private sub cmdAdd_click()
dim conn as ado.connection
dim rst as ado.recordset

Set conn = New ADODB.Connection

conn.Provider = "Microsoft.JET.OLEDB.4.0"
conn.ConnectionString = "<YOUR MDB FILE>"
conn.Mode = adModeReadWrite

set rst=new adodb.recordset "<YOUR INSERT STATEMENT>", conn, adOpenForwardOnly
set rst=nothing
set conn=nothing
end sub
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!


Respected sir
i have one datagrid and one command button whenever i click command button one row will increase.
how can i increase?
waiting for ur rep


thank u for ur rep

just add the "datagrid1.refresh" command after your insert statement. it is important that refresh your grid to update your entries.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial