PC Review


Reply
Thread Tools Rate Thread

add records to a table by VBA programming

 
 
=?Utf-8?B?amVzc2ljYQ==?=
Guest
Posts: n/a
 
      3rd Feb 2005
I am new on the VBA, but I want to add a record to inventorytransaction table
automatically(user need press a button to fire the event) after collecting
the individual field information from another table via form. Is this can be
done by VBA?
Which command should I look after?

Thanks.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWF0dGhldw==?=
Guest
Posts: n/a
 
      3rd Feb 2005
use the database and recordset objects.

an example.

dim DBS as database 'delcare the database object
dim RST as recordset 'declare the recordset object

set DBS = currentdb 'set the object = to the current db
set RST = currentdb.openrecordset("tablename") 'set the recordset object =
the table you wish to work with

with RST 'use the with statement so you dont have to type rst.<method>
everytime
.addnew
.fields("fieldname").value = variable
.fields("fieldname").value = variable
.update
end with



"jessica" wrote:

> I am new on the VBA, but I want to add a record to inventorytransaction table
> automatically(user need press a button to fire the event) after collecting
> the individual field information from another table via form. Is this can be
> done by VBA?
> Which command should I look after?
>
> Thanks.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude records from a report using programming. jubu Microsoft Access VBA Modules 4 16th Apr 2008 02:47 PM
Excel Food Price Table, Programming, Is This Table All Right? =?Utf-8?B?RGF2aQ==?= Microsoft Excel Misc 2 3rd Jun 2007 12:24 PM
Show only records in table A without matching records in table B =?Utf-8?B?UGF1bG8=?= Microsoft Access Queries 1 15th Mar 2007 05:34 PM
Copy Records from Access Database table(more than 5 lakh records in this table) to Excel Sheet divya Microsoft Excel Programming 1 26th Oct 2006 12:12 PM
Re: Database-programming adding records Bob Microsoft Frontpage 1 15th Jan 2005 08:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:21 PM.