Dixie <dixie@dogmail.com> wrote:[color=blue]
> Had a quick look at the help file, but it is mainly about creating new
> tabledef objects and I don't want to iterate through the tabledef
> collection.
>
> Say there was already a table in the database called 'MyTable' and I
> wanted to add a field called MyNewField and then say set it as a text
> field of 25 characters. How do I do that in code.
>
> dixie[/color]
You don't need to iterate through the collection...
eg. CurrentDB.TableDefs("tblMyTable").Fields("myField" )
[color=blue]
> "Br@dley" <n0mail@4u.com> wrote in message
> news:Penye.14792$oJ.7716@news-server.bigpond.net.au...[color=green]
>> Dixie <dixie@dogmail.com> wrote:[color=darkred]
>>> I wish to be able to do some things to tables in code.
>>>
>>> 1. Add a field and its properties.
>>> 2. Alter the properties of an existing field in a table.[/color]
>>
>> Lookup the help on the Tabledef oject.
>>[color=darkred]
>>> 3. Append some extra entries onto the bottom of a table, if they are
>>> not already there.[/color]
>>
>> Search for the record. If it doesn't exist then add it.
>>
>> eg. (very simplified DAO example)
>>
>> myRS.FindNext "[myID] = 1"
>> If myRS.NoMatch then
>> myRS.AddNew
>> myRS![myID] = 1
>> myRS.Update
>> End If
>>[color=darkred]
>>> Any help would be appreciated.
>>>
>>> dixie[/color]
>> --
>> regards,
>>
>> Bradley
>>
>> A Christian Response
>>
http://www.pastornet.net.au/response[/color][/color]
--
regards,
Bradley
A Christian Response
http://www.pastornet.net.au/response