for each record action??

piWer

New member
Local time
Today, 22:34
Joined
May 6, 2004
Messages
8
Hi.

I want to asign some actions for each record in query. To be precise it has to write data from query on one Form into FIELDS on another form... otherwords:

CODE on FROM Form

set rst = recordsetclone

For each RECORD(<---do not know what have to be hare) in rst
if field222.text = "some value" then forms!secondform!field1.text = field222
..
..
end if
next

????
How to do this?? i`ve searched for similiar topic on the Web but found nothing :( Help please.
 
couldn't you do a simply update query. This is assuming that the table are linked by an ID number
 
I think not, because i have on one side a form based on a Query with precise Recordset and on another hand a Form based on a Table with 10 fields. and now, if the record from Form 1 contains f.ex word "dog" then code have to put this value into the second Form`s field 1. Sorry but i can`t be more precise. My english is not so fluent ;)

This is easy, but the code have to do this for Every record on form 1. and when i try to do simply if field1.value = "dog" then ....write it to other form`s field ... then the code put`s the last found word on the query.

so i wanted to do For Each ..... in recordsetclone, but do not know how ;/
 
:)
Thx for explanation but now i would be gr8full for an example how to do this.

I think i`ve found a way to describe my situation to You.
I have 2 tables.

One:
id, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10

Two:
id, Name, Price

Easy. The second table contains Stable names (f.ex. Apple, peach...) and it`s price.

And now i have to put the price.value into one of the Table`s ONE fields, which depends on name.text value.

otherwords (as i wrote before) if name.text = "Apple" then field1.value = price

How to do that??
 
Hmm Pat, thx for explanation but i see that i couldn`t describe it to You well. My english is not very fluent and that`s all. I`ve wrote a Database based on Access which is the only App in my company that the sellers work with, nevermind... Tables are normalized, and forms, etc. I can write everything that uses VBA but when it goes for DAO or ADO or etc. i`m powerless. i`m not writing in VB but in VBA.

Thanks for help guys but i`ll seek elsewhere... maybe in Polish books.
 

Users who are viewing this thread

Back
Top Bottom