How do I check to see if column exist before adding it. New to VBA and having a problem testing for this condition.
Public Sub keyColumn()
DoCmd.RunSQL ("ALTER TABLE 3BSM_bom_template " & "ADD keyColumn COUNTER;")
End Sub
How do I check to see if column exist before adding it. New to VBA and having a problem testing for this condition.
Public Sub keyColumn()
DoCmd.RunSQL ("ALTER TABLE 3BSM_bom_template " & "ADD keyColumn COUNTER;")
End Sub
A db design that requires routine modification of table (adding fields) is probably not a normalized structure.
Why do you need to programmatically add field? Why not just open table in design view and modify?
Checking if field exists will probably require looping through table Field Collection.
Bing: Access VBA does field exist in table
http://forums.devarticles.com/micros...vba-58559.html
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Its not a db per say. Im importing a very complicated spreadsheet and using access to manipulate with another spreadsheet. The structure of spreadsheets can not be changed.
This is a periodic event?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
ONce a week at the most.
If you're still wanting to check whether fields exist within a table, you'll want to take a look at the TableDefs DAO structures.
You may also want to look at PowerQuery in Excel, depending on what you're trying to accomplish.