A
Angela_Marie
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
doesn't contain the automation object 'Patient Insurance Table'". I have read
several postings on this subject but I still cannot figure out what I am
doing incorrectly. Here are the details:
I have a tabbed form with several subforms. One of the subforms is based on a
Query that includes the tables "Insurance Table" and "Patient Insurance
Table". The Patient Insurance Table has a Primary key named "Patient ID#"
and a foreign key named "Insurance#". I want each insurance for a particular
Patient ID# to be numbered sequentially for that patient only. So, the first
insurance added for a patient should be numbered 1 and the next to be
numbered 2 and so on... The reason that the Insurance Table is included in
the subform query is because I have information from that table populating
the form when a particular insurance is selected.
The macro is written as follows:
SetValue
Item: [PATIENT INSURANCE TABLE]![Insurance#]
Expression: Nz(DMax("[Insurance#]","Patient Insurance Table","[Patient
Insurance Table].[Patient ID#]=" & [Patient Insurance Table].[Patient ID#]),0)
+1
Event: BeforeUpdate
I look forward to being embarrassed by how easy this is to fix!
Thank you!
the value for a field and I keep getting the error message "The object
doesn't contain the automation object 'Patient Insurance Table'". I have read
several postings on this subject but I still cannot figure out what I am
doing incorrectly. Here are the details:
I have a tabbed form with several subforms. One of the subforms is based on a
Query that includes the tables "Insurance Table" and "Patient Insurance
Table". The Patient Insurance Table has a Primary key named "Patient ID#"
and a foreign key named "Insurance#". I want each insurance for a particular
Patient ID# to be numbered sequentially for that patient only. So, the first
insurance added for a patient should be numbered 1 and the next to be
numbered 2 and so on... The reason that the Insurance Table is included in
the subform query is because I have information from that table populating
the form when a particular insurance is selected.
The macro is written as follows:
SetValue
Item: [PATIENT INSURANCE TABLE]![Insurance#]
Expression: Nz(DMax("[Insurance#]","Patient Insurance Table","[Patient
Insurance Table].[Patient ID#]=" & [Patient Insurance Table].[Patient ID#]),0)
+1
Event: BeforeUpdate
I look forward to being embarrassed by how easy this is to fix!
Thank you!