Angela Marie,
This doesn't quite hold together. You are trying to assign a value to a
field which is the foreign key field, but kind of using it as a type of
serialising number. So that means the primary key in the Insurance
table is being used to serial number the Patient Insurance records. Is
that right?
By the way, it is not a good idea to use a # as part of the name of a field.
And in direct answer to your question (though I think there is a design
problem to be resolved first), the arguments of the SetValue macro
action should be like this...
Item: [Insurance#]
Expression: Nz(DMax("[Insurance#]","Patient Insurance Table","[Patient
ID#]=" & [Patient ID#]),0)+1

Signature
Steve Schapel, Microsoft Access MVP
> I am attempting to create a macro in a subform that will automatically set
> the value for a field and I keep getting the error message "The object
[quoted text clipped - 21 lines]
> I look forward to being embarrassed by how easy this is to fix!
> Thank you!