updating records

kwtmd

Registered User.
Local time
Today, 14:02
Joined
May 21, 2004
Messages
46
I am having difficulty updating records since I referentially linked a field. The following code was working fine and allowing me to add records. Since I linked the ProbNum field in 2 tables, I am now getting an error that states "you cannot add a record or change a record because a related record is required in the 'table'"..... Notably it works sometimes and others it does not work. I am adding the field 'Probnum' which is the related field? any ideas?

field1 = rec("ProbNum")
field2 = rec("goal")
field3 = rec("checkbox")
field4 = rec("daystocomplete")

rec2.AddNew
rec2("ProbNum") = field1
rec2("goal") = field2
rec2("PatNum") = intPatNum 'this is a function
rec2("GoalDate") = Date + field4
'Stop
rec2.Update
 
thanks for your help and advice. I found my problem. I had mistakening 'linked' a field that was wrong.

I still struggle with knowing when to use . [] or !. I read the knowledge base info, but still find it confusing... thanks.... Ken
 

Users who are viewing this thread

Back
Top Bottom