Results 1 to 7 of 7
  1. #1
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70

    id changes on its own

    can anyone help me understand and fix why main ID is auto changing when lookupID is populated?


    i have two tables tblCategory and tblCodes, relationship is 1 tblCategory to many tblCodes
    main form "fCodes" - macro = On Load = gotoRecord ,, New

    LookupID text box = "txtLookupID"

    combo box which is looking for category in tblCategory "cmbCategoryLooup"
    sql(SELECT [tblCodesLookup].[ID], [tblCodesLookup].[Category] FROM tblCodesLookup ORDER BY [Category]; )

    cmbCategoryLookup after update
    Private Sub cmbCategoryLookup_AfterUpdate()
    Me.txtLookupID = Me.cmbCategoryLookup
    End Sub

    "txtLookupID" is populating correct field from tblCategory.ID
    my problem is when I select from cmbCategoryLookup combo box, ID field from tblCodes is updated as well and i need this to be new record so for ID to stay "(new)"

    can anyone please advise?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Sounds like combobox is bound to wrong field but then I find your description of issue confusing. If you want to provide db for analysis, follow instructions at bottom of my post. Identify which form is involved.
    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
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    i have attached sample. i think the issue is with combo box but not sure how since its just looking for category types and im using its id as lookup id to add new record. this has to be something very small, i must be having a blonde moment
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I am not seeing the behavior you describe. I did:

    1. open form - the macro assures that a new record has focus

    2. select category and enter other data

    3. navigate to new record and repeat

    As far as I can tell, the form acts according to design. The records are correctly saved to tblCodes.
    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
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    interesting, are you using access 2010?
    i just tried it now from my personal comp using 2010 and its working fine but today from my work comp using access 2007 where i built it i was having this issue the moment i click on combo box it populates the lookupid as well as random id of another record.
    ill have to check it out tomorrow at work, maybe some kind of glitch

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I was testing with Access 2007.
    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.

  7. #7
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    i tried it today and its working just fine. seems like lately whenever i have some very strange issues just reboot the comp hehe.
    thanks

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

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