Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

field: delete, rename, set index property to yes in VBA

Status
Not open for further replies.

watsi

Technical User
Oct 18, 2002
3
CA
Hello. I'm a novice in Access VBA.

I have a some fields in a table that i would like to manipulate.
ie. delete a field, rename and set index property.


For example, tblstudent has the fields First and Last

How do I (in VBA):
1. delete the field "First"
2. rename "Last" to "LastName", and set it's Indexed property to "yes with duplicates"?

Thanks for all your help.
 
Maybe you could manage that with the RunSql method.

For example

DOCMD.RunSQL "UPDATE examplerow FROM exampletabel WHERE criteria"


If you want to have a complete VBA code then you have to use the update methode.

For example

With variab
!example = muster
.Update "value"
end with
 
Thanks so much for your reply. I'm not all that familiar with VBA or SQL yet.

How would I customize the DOCMD.RunSQL "UPDATE examplerow FROM exampletabel WHERE criteria" to fit my problem?

I would like to delete the field "First" in table "tblStudent" and rename the field "Last" to "LastName", and set it's Indexed property to "yes with duplicates"?

Many thanks to you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top