Inserting a column using vb

TTR9000

New Member
Joined
Nov 3, 2003
Messages
29
This is the code I have in Module1 which runs when the db is opened I would like to insert a column at the end of the Prosaim 852 Table before the table is opened. I also would like to name the new column Proto Number.

Here is the Code

Function AutoExec()

DoCmd.SetWarnings False

DoCmd.OpenQuery "proto mat", , acReadOnly
DoCmd.OpenQuery "Prosaim852 Query", , acReadOnly
DoCmd.OpenTable "Prosaim 852 Table", , acReadOnly

End Function
 
Try this:

Code:
SELECT Prosaim852.[EDI Type], Prosaim852.[Duns+4], Prosaim852.Payer, Prosaim852.[Sold-To], Prosaim852.UPC, Prosaim852.[Customer Number], '' AS Proto_Number INTO [Prosaim 852 Table] 
FROM Prosaim852;
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,221,672
Messages
6,161,199
Members
451,688
Latest member
Gregs44132

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top