Vba – How to add new record to subform

ms-accessvba

I recently got help on When select value from combo, highlight that record in Access subform datasheet and now I'm trying to do a related task.

How can I make the subform give me a new row for data entry from a button on the main form?

Tried the method found here with no luck: http://www.access-programmers.co.uk/forums/showthread.php?t=26537

EDIT: Not sure if it matters, but the table my subform is supposed to update is a linked table to SQL Server.

Best Answer

Please first make sure your recordsource is updateable by opening the table or query in which your subform recordsource is based, and ensure that you can edit and add new records. If not, then it's possible that your SQL Server linked table is missing a unique indentifier. To create one, simply delete the linked table, and relink it. Upon relinking, MS Access should prompt you to specify a unique index (may take more than one field to make it truly unique). Then try again.

Related Topic