Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Value AND Field Description Property

Status
Not open for further replies.

air1access

Technical User
Jan 27, 2008
123
US
I am trying to update one table with data from another as well as a field property value (description)...
It like I can almost get it to work...!! Ha..!!
Just not setting up the references to the table the right way I guess...
Below is what I am working with...
Any suggestions or examples would be greatly appreciated..!!!

Thanks in advance..!!
air1access

rs1.MoveFirst
Do While Not rs1.EOF
For i = 1 To FieldCount - 1
If Not IsNull(rs1("Value" & i)) Then
rs2.AddNew
rs2!IID = rs1!IID
rs2!Value = rs1("Value" & i)

Set tbl = db.TableDefs(rs1)
Set fld = tbl.Fields
Set prp = rs1.Properties("description")
rs2!Ck_Type = prp.Value

rs2.Update
End If
Next i
rs1.MoveNext
Loop
 
Not sure why you need to do this. I believe the Description property must first be created before it can be updated. Use your favorite web search page with 'access field.createproperty'

Duane
Hook'D on Access
MS Access MVP
 
Not wanting to update the description property for the fields. They are already updated, just want to "read" the description property for each field and update that to a different table fields value... I hope this makes sense..!!!
 
You are setting a property:
air1Access said:
Set prp = rs1.Properties("description")
Then you state:
air1Access said:
Not wanting to update the description property for the fields.
... update that to a different table fields [red]value[/red]

If the field description hasn't been set/created in the design interface or in code it will not exist and will generate an error if you attempt to reference it.

Duane
Hook'D on Access
MS Access MVP
 
Anyway, I'm not sure the following statement don't raise an error:
Set tbl = db.TableDefs(rs1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Dang..
Sorry about this.. After all that - I was just told that the data I'm building is no longer needed... Next project..!!
Thanks for the help fellas..!!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top