Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 18th, 2005, 02:38 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to add indexes for my customer table?

Hi guys. I got unbounded form that I want to add searching functionality by utilizing indexes. I would like to know how to add indexes for my customer table so that I can use it for searching records. I be happy if some one help with make indexes. Thanks


http://i5.photobucket.com/albums/y18...abledesign.jpg


==> pic of my customer table in design view
 
Old June 20th, 2005, 09:02 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

Hmmm.. not really sure what you are after... but I sense you arent either.

Your table has an index on the ID field anyway... you could put one on the text field, but not sure it is going to help that much really.
If you wanna put one on it... when in design view, just go >View >Indexes and add it in, if it isnt already, which it probably will be, knowing Access!
You've posted this in the VB section, so you might imagine this would be done in VB, it can be.. just not sure why you'd want to?

But like I say, I doubt this is actually what you asking...
 
Old June 24th, 2005, 06:12 AM
Authorized User
 
Join Date: Jul 2004
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

I can't really see why you would need to do this either, but the code you would need is

DoCmd.RunSQL "CREATE INDEX A on [table-name] (field1, field2, ....) [WITH PRIMARY]"

where A is the name of the index (it doesn't matter what it's called), the field list allows you to make a compound index, and if the index is NOT Primary omit the [WITH PRIMARY]



 
Old June 24th, 2005, 09:10 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

So glad I'm not the only one who is missing the whole point of this one!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Table Indexes prabodh_mishra SQL Language 1 August 25th, 2006 04:39 AM
Customer table missing? doanhvu BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 June 27th, 2006 12:57 AM
How to refrence acces Indexes table method Access 6 July 19th, 2005 05:03 AM
Too many indexes on table error message rohan_man Access 9 February 3rd, 2005 07:31 AM
Customer table Update solva Access VBA 1 December 21st, 2003 02:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.