define field name

J

judith

I want to cycle round fieds in a data set F1, F2, F3 ... etc
How do I say
Do While iField <= nField
condition = rstImport!["F" & ifield]

Thanks
 
C

Clifford Bass

Hi Judith,

You are close. Change the one line to:

condition = rstImport.Fields("F" & iField)

Clifford Bass
 
J

judith

That worked great thanks. Can I ask a quick follow up please

I have now picked out my 2 values and want to append them to another
recordset but am not quite sure how to actually get the data to write to the
table. My code does not seem to write the record

Set rstAppend = dbsNetInfo_OpenRecordset("webConditionTemp")

With rstAppend
rstAppend![reg] = reg
rstAppend![condition] = condition
.Append

Any suggestions please.


Clifford Bass said:
Hi Judith,

You are close. Change the one line to:

condition = rstImport.Fields("F" & iField)

Clifford Bass

judith said:
I want to cycle round fieds in a data set F1, F2, F3 ... etc
How do I say
Do While iField <= nField
condition = rstImport!["F" & ifield]

Thanks
 
C

Clifford Bass

Hi Judith,

You are welcome. And sure.

Usually to add records you do the following (also, if you use the With,
you do not need to repeat the item mentioned on the With line):

With rstAppend
.AddNew
![reg] = reg
![condition] = condition
.Update
End With

That should work with either DAO or ADO.

Clifford Bass
 
Top