MS Access with VBA: How to make a Field on a Form that adds a new columns to table by lookup?

  Kiến thức lập trình

I need to create a Field that will function as a Lookup Field but that will look up Column Name (instead of cell content, as in the traditional Lookup Field) and add a new Column with the name specified if none exists. How can I do this, if not by inbuilt Fields by using VBA scripts?

I tried a Lookup Field and restructuring the database so that the parameters are all cell content as well. This involved taking the names of the Columns, which are different chemicals, and moving them into cells under a single “Chemical Name” Column. However, this led to a LOT of entries and increased the row count by 10x. This level of complexity makes exporting content more difficult, and though there is likely a way to reformat programmatically in VBA more easily than to create a new Field in VBA, I find that neither of these seems optimal. I am open to suggestions, please help!

LEAVE A COMMENT