PC Review


Reply
Thread Tools Rate Thread

can't change the data type or field size

 
 
Steve Stad
Guest
Posts: n/a
 
      10th Jan 2010
I am creating/editing updating fields in table design. I am trying to change
the field size of the first field. But getting message.. 'You can't change
the data type or field size of this field, it is part of on or more
relationships. I deleted the relationship and still get the message. Can I
screw anything up if I delete any other relationships. Or does access
re-connect all relationships on demand.
Thanks for any replies.
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      10th Jan 2010
On Sat, 9 Jan 2010 17:12:01 -0800, Steve Stad
<(E-Mail Removed)> wrote:

>I am creating/editing updating fields in table design. I am trying to change
>the field size of the first field. But getting message.. 'You can't change
>the data type or field size of this field, it is part of on or more
>relationships. I deleted the relationship and still get the message. Can I
>screw anything up if I delete any other relationships. Or does access
>re-connect all relationships on demand.
>Thanks for any replies.


You may have a hidden relationship; for example, Lookup fields create
relationships which may not show in the relationships window. Also, the
relationships window can be misleading: if you just delete a table icon, the
join line disappears but the relationship doesn't. You must select and delete
the *join line itself*.

Try the "Show All Relationships" icon on the relationships window, or call
this code from the Immediate window:

Sub ShowAllRelations()
Dim db As DAO.Database
Dim rel As Relation
Dim fld As Field
Set db = CurrentDb
For Each rel In db.Relations
Debug.Print "Relation "; rel.Name, rel.Table, rel.ForeignTable
For Each fld In rel.Fields
Debug.Print fld.Name; " linked to "; fld.ForeignName
Next fld
Next rel
End Sub
--

John W. Vinson [MVP]
 
Reply With Quote
 
Steve Stad
Guest
Posts: n/a
 
      11th Jan 2010
John - Thanks for quick reply. I tried this code in the immediate window.
....to 'call
this code from the Immediate window'?? do I compile??...step into??...run
macro??? sorry i am a newbie particualy w/code. What should I expect to
see? I opened the imediate window from blank form/design mode.

Private Sub Form_Load()
Sub ShowAllRelations()
Dim db As DAO.Database
Dim rel As Relation
Dim fld As Field
Set db = MasterDB
For Each rel In db.Relations
Debug.Print "Relation "; rel.Name, rel.Table, rel.ForeignTable
For Each fld In rel.Fields
Debug.Print fld.Name; " linked to "; fld.ForeignName
Next fld
Next rel
End Sub


"John W. Vinson" wrote:

> On Sat, 9 Jan 2010 17:12:01 -0800, Steve Stad
> <(E-Mail Removed)> wrote:
>
> >I am creating/editing updating fields in table design. I am trying to change
> >the field size of the first field. But getting message.. 'You can't change
> >the data type or field size of this field, it is part of on or more
> >relationships. I deleted the relationship and still get the message. Can I
> >screw anything up if I delete any other relationships. Or does access
> >re-connect all relationships on demand.
> >Thanks for any replies.

>
> You may have a hidden relationship; for example, Lookup fields create
> relationships which may not show in the relationships window. Also, the
> relationships window can be misleading: if you just delete a table icon, the
> join line disappears but the relationship doesn't. You must select and delete
> the *join line itself*.
>
> Try the "Show All Relationships" icon on the relationships window, or call
> this code from the Immediate window:
>
> Sub ShowAllRelations()
> Dim db As DAO.Database
> Dim rel As Relation
> Dim fld As Field
> Set db = CurrentDb
> For Each rel In db.Relations
> Debug.Print "Relation "; rel.Name, rel.Table, rel.ForeignTable
> For Each fld In rel.Fields
> Debug.Print fld.Name; " linked to "; fld.ForeignName
> Next fld
> Next rel
> End Sub
> --
>
> John W. Vinson [MVP]
> .
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      12th Jan 2010
On Mon, 11 Jan 2010 13:41:02 -0800, Steve Stad
<(E-Mail Removed)> wrote:

>John - Thanks for quick reply. I tried this code in the immediate window.
>...to 'call
>this code from the Immediate window'?? do I compile??...step into??...run
>macro??? sorry i am a newbie particualy w/code. What should I expect to
>see? I opened the imediate window from blank form/design mode.


Sorry! Too brief there on my part.

Open the database. Find the Modules tab and create a new module. Copy and
paste


PUblic Sub ShowAllRelations()
Dim db As DAO.Database
Dim rel As Relation
Dim fld As Field
Set db = MasterDB
For Each rel In db.Relations
Debug.Print "Relation "; rel.Name, rel.Table, rel.ForeignTable
For Each fld In rel.Fields
Debug.Print fld.Name; " linked to "; fld.ForeignName
Next fld
Next rel
End Sub

into a new Module. Click Debug.Compile from the Menu; post back if you get any
errors.

Save the module using some name OTHER than ShowAllRelations - basRelations
maybe.

Then type Ctrl-G if the immediate window isn't visible. When it is, type

Call ShowAllRelations

into the immediate window.

You should see a scrollable list of all your table relationships.
--

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Field Data Type? Chertsey Microsoft Access External Data 1 4th Aug 2009 06:46 PM
Text data type field size Stephen @ ZennHAUS Microsoft Access 11 15th Jan 2009 03:03 AM
Text data type field size Stephen @ ZennHAUS Microsoft Access Database Table Design 11 15th Jan 2009 03:03 AM
You can't change the data type or field size of this field error. =?Utf-8?B?TWVsYW5pZQ==?= Microsoft Access 2 3rd Aug 2007 03:08 PM
Unable to change data type in field options when importing data f. =?Utf-8?B?SmluTXF0?= Microsoft Access External Data 1 21st Jan 2005 10:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:38 AM.