I have two Tables. One table holds a patient’s demographic data. The second holds the contact information. One of the fields in the Contact information is the [contact number]. In the data entry form, the record source is the Main Information table with the demographic details, then I have a subform for the contact information (because there can be more that 1 contact for a patient).
In the Contact Information subform, how can I automatically increase the Contact Number when a new contact is made? Currently I have a control button (Add a New Contact) and in the On Click event I have the following command “IIf([Main Information]![ID]=[Contact Information]![Contact ID],Sum([Contact Information]![Contact Number]+1),””)
([Main Information]![ID] is an autonumber and is linked to [Contact Information]![Contact ID] in a query).
The error message I’m getting is that Access can’t find the macro (then my iif statement)