Hello All,
How to copy a structure of an existing table to a new table and also i need to change a particular field in that table to Primary key. (in MS Access) i can create it using gui but i need it in code. Please help me for this code.
Thanx in Advance
Madhan

Help to create a new table using VBA codes
CBuilder
HI Derek,
Thanx A lot.
Madhan
blex
Hey Madhan,
VBA is really a different flavor of Visual Basic (but not VB.NET) thats revolves around an application. For example VBA in Excel is Visual Basic but geared for Excel, VBA for Access is the same but for Access. To know VBA for these you need to know how the application works, you need to know Excel pretty well in order to use it's VBA.
The best thing you could do is pickup a beginners guide to Visual Basic, but not VB.NET which is completely different. Visual Basic is the language that VBA derives from, there is a lot of cross over. You can pick up a beginners guide to Visual Basic fairly cheaply. Anything from version VB4 upwards should be fine, VB6 would be good.
Here's a tutorial site here that should get you started
http://www.vbtutor.net/vbtutor.html
alberich
Hi Madhan,
You have a couple of approaches. Look at the TableDef object, which is part of DAO, this lets you alter the definition of a table. The other option is to use ADO and that involves adding a referenc to Microsoft ADO Ext. 2.7 for DLL and Security objects. In here there is a collection of objects that let you modify table and database structure for example the Table and Key objects.
I don't have any specific code for you but the help files and some educated guesses should get you there.
Fahd
Hi Derek,
Thanx a lot for ur reply. Can you do me a small favour is there any tutorial or Book or Site that can teach me VBA from basics. I am new to that. Please Derek can you do this favour I got one but its for expert or Pro level.
Thanx in Advance.
Madhan