Results 1 to 5 of 5
  1. #1
    sleake is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    51

    Bound primary autonumber ID field instead of "city" field and want to change ID to city name

    Made the mistake of making the ID field the bound field and want to have the city name instead of the ID field written to the table. I've changed the bound field to 2. How would I go about designing a query to change the values instead of going through records and re-selecting the city?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    Create another field for the city name. Build a query that joins tables on the ID fields. Switch it to an UPDATE query, populate the new field. Delete the old field.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sleake is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    51
    I have created the following update query using the new field City2, but am, of course, getting a type mismatch error because of the criteria, where I've tried to link a text field to a number field. Can you point me in the right direction?
    Click image for larger version. 

Name:	UpdateQuery.jpg 
Views:	6 
Size:	30.2 KB 
ID:	19455

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    My instructions about the linking were not clear. The link should be on the tbl_List_City ID and its related foreign key field in tbl_Contacts which would be City field. Change City field to a number type if it actually has ID number data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    sleake is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    51
    Thanks so much. That did the trick. Problem solved. I'll mark this solved.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-18-2015, 07:02 AM
  2. Replies: 5
    Last Post: 11-23-2014, 03:54 PM
  3. Replies: 7
    Last Post: 05-12-2013, 05:15 AM
  4. Replies: 3
    Last Post: 04-22-2013, 06:08 AM
  5. change field to "password" type
    By ducecoop in forum Access
    Replies: 3
    Last Post: 11-11-2010, 12:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums