copying and pastying

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

Guest

Hi, I'm new in VB and I'm trying to achieve a copy and paste work

Let me explain what I want to do:
I have a table1 with id (autonumber),product code (number), product
desc(text), stock(number) and order(number) columns, with this columns I
crated a query and I added the column total:([stock]-[order]), also I add an
iff column, that shows 1 if the order is different than 0 and else 2.
What I want to do is: when a macro is run, make an if structure, (if number
in iff column is 1 then….) the number in the total column of the query is
copied, pasted in the stock column, and then erase the order cell.

Almost all the VB part I know how to do it (and in excel I know exactly how
to do it) what I don’t know is how to call a specific cell in acces using VB
(something like excels activesheet.cells(1,1) function)

Also I want your opinion if a sendkeys function should be used in my program
structure.

I wait your answer

Tks.
 
So have you already written some VB code? What you going to need to do is
write some code that loops through your recordset (i.e. query). When doing
so, you can refer to individual cells such as rs("stock"), rs("product code")
for their values. And since you loop through line by line, you are only on
one active row at a time.
 
Back
Top