As you can see, adding a new record to an Access database is pretty easy. For example, suppose we no sooner add the computer atl-ws-99 to the database then Ken Myer gets transferred from the Human Resources department to the Finance department. We want to update the record for the computer named atl-ws-99; as you might expect, that becomes our search criteria, using the format Note the somewhat unusual syntax we use when referring to the Department field: obj Recordset. On the bright side, odd as it might look, at least it’s the same way we refer to fields when reading from a database (as we did last week).That means we now have to update the department field for that particular computer. OLEDB.4.0; " & _ "Data Source = c:\scripts\inventory.mdb" obj Record Set. Also, don’t overlook the Update method; once again a record will not be changed until you call Update.Today we’re going to get right down to business: let’s show you how to add a new record to an existing database.To begin with, we’re assuming you have an Access database named living in the C:\Scripts folder.
"Support" wrote in message news:40***********************@mercury.... Is it possible to add a record in one table and have Access automatically add date from one of the fields into another table??We’re also assuming that this database has a table named General Properties, and that the General Properties table includes the following fields: have such a database then none of these sample scripts will work.That doesn’t mean you can’t learn anything from them; you just won’t be able to run them and get them to do anything. OLEDB.4.0; " & _ "Data Source = c:\scripts\inventory.mdb" obj Record Set. We should note that this is not the only way to add a new record to a database.Is it possible to add a record in one table and have Access automatically add date from one of the fields into another table??In more detail: Table1 has the following fields: Product_ID, Price, Weight etc...Well, here’s a hint: any time the Scripting Guys decide to “expand upon a previous column” then you know they’re taking the lazy way out and not even to think up something new.So what does that have to do with this week’s column? Since you mentioned it, though, this week we’ve decided to expand upon a previous column, one in which we showed you how to connect to and read from a Microsoft Access database.(These fields, of course, are the fields found in the table General Properties.) For example, this line sets the value of the Computer Name field to atl-ws-99: Note that the value being assigned (atl-ws-99) is enclosed in double quote marks; that’s because Computer Name is a text field and is expecting to be assigned a string value. Close You probably already noticed that the first half of this script is identical to the script that adds a new record: we connect to the database, then use the Open method to return a recordset consisting of all the records in the General Properties table.If a database field is numeric or Boolean (true/false) then you should will be updated to contain the new record, but the actual database will remain unchanged. In fact, you won’t find any differences between the two scripts until we get to here: In this line of code we’re simply assigning the search criteria to a variable named str Criteria. Don’t worry too much about that; that’s just the way you have to do things.If products are always entered into a form, you can use the After Insert event of the form to Execute an Append query statement to insert a record into Table2. "Support" wrote in message news:40***********************@mercury.... Is it possible to add a record in one table and have Access automatically add date from one of the fields into another table??Anyone care to enlighten me - or point me in the direction of a tutorial??