Using Vb in access to alter records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay,

I am using access, what I want to do is put data into a new record. I know
how to select a new record, but I do not know how to manipulate it once that
record is selected .

once I do this:
DoCmd.GoToRecord acDataTable, "tablename", acNewRec

how do I put data into the new record and how do I select which column in
the row I want to alter?
 
Execute an Append query statement, e.g.:
strSql = "INSERT INTO ...
dbEngine(0)(0).Execute strSql, dbFailOnError

To get the SQL statement:
1. Create a new query. No table.

2. Type the value you want to add into a fresh column in the Field row,
e.g.:
99

3. Change it to an Append Query (Append on Query menu)
Access will ask what table to append to.

4. Switch to SQL View (View menu.)
There's an example of the string you need to execute.
 
Dude don't listen to these guys

DAO IS DEAD
if you MUST use this strSql method; then do
CurrentProject.Connection.Execute- that won't give you a memory leak
for starters

DAO is one huge memory leak; and it's impossible to use reliably.

needing to close down objects should not be necessary; DAO is just a
bullshit library
 
Back
Top