Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Join Date
    Jul 2012
    Posts
    22

    Saving data back into a table from a form

    I'm definitely doing this wrong and I've Googled and Googled and I can't seem to find an answer so I'm hoping someone can help me.
    I have a new Client form where I want to pull the last 4 digits of the phone number to create the customer number.
    In the customer number field I have placed the code =(Right([Main Phone],4) into the Property Sheet > Control Source which pulls the last 4 digits of the phone number.
    The issue is that this number is not saving back to the table. Can someone tell me how if I've placed the code in the right place and how I would get this code to save back into the table?
    I may be going about this totally backwards, I'm not sure!


    Thanks so much!!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    For starters, that isn't a good candidate for a customer number, given the likelihood of duplication. I'd just use an autonumber, or perhaps the entire phone number. In any case, the second section:

    http://allenbrowne.com/casu-14.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Jul 2012
    Posts
    22
    Thanks Paul - Here's my main issue. I can't figure out how to link my customer table to my installation table through a 1 to many relationship. If I link the 2 ID's with autonumbers it will only allow a 1 to 1 and a customer could potentially have multiple installations. So I thought if I could create an auto customer number that we don't have to type in, then I might be able to link that instead. I can't link the customer ID with any other field and get that 1 to many relationship. I've gone through tutorials on Lynda.com and everything and I just don't understand why this is so difficult to just link 2 tables. I have to link the ID to the same type of field right? But I don't have any other field in the installation table other then the ID that would ALWAYS be filled in with a number....

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The autonumbers wouldn't relate to each other. The installation table would (could) have an autonumber field as its primary key, and then it would have a separate field (Number/Long Integer) for the customer number. That field would be related one-to-many to the autonumber field in the customer table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Join Date
    Jul 2012
    Posts
    22
    Ok so - i feel like this is a stupid question, but if I already have an autonumber Installation ID which is the primary key, how would I make a separate Number/long integer field for the customer number where our sales staff don't actually have to Type a number in? At this point we don't actually have "customer Numbers" or "Installation Numbers" so the slate is blank.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    With the installation table in design view, you'd add a new field, and give it that data type. On a form bound to the installation table, you'd typically use a combo box that got its selections from the customer table but was bound to this new field in the installation table. The combo box wizard should walk you through that part.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Join Date
    Jul 2012
    Posts
    22
    Ok - Thank you!!! Thank you!!!! - I think I'm almost there... I've got the relationship made with the combo box pulling the ID number and it's bound to the new field. Although I'm noticing that the ID number in the Combo box is not being saved into the new field - the new field shouldn't be empty should it?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No, it shouldn't (presuming the main record is being saved). What is the control source of the combo? It should be the new field.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Join Date
    Jul 2012
    Posts
    22
    yes, I have the control source as the new "Customer number" field that I created. So how does this link to the field in the table if the new table field is blank... does it link to the whole data row?

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    Join Date
    Jul 2012
    Posts
    22
    I'm not seeing a button to allow me to post the database. Just images or video... can I send it to you using something else or is there something I'm missing here??

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Click on the "Go Advanced" button, then you'll see a "Manage Attachments" button below. Typically best if you compact/repair the db and then zip it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    Join Date
    Jul 2012
    Posts
    22
    Ok - I've made a public dropbox for the files and erased all my data out of the database. The backend is protected with a password of 1111@Skyview
    https://dl.dropbox.com/u/98289512/Sk...ST-db_be.accdb
    https://dl.dropbox.com/u/98289512/Sk...-TEST-db.accdb
    Thanks so much for your help!!!

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What form are we looking at? Why do you have tables and forms for different people?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    Join Date
    Jul 2012
    Posts
    22
    Ah ok thanks! Just incase you didn't get the dropbox...skyviewdb-test.zip

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form-Combo Box-Saving value to table
    By Jill in forum Forms
    Replies: 2
    Last Post: 12-06-2012, 03:13 PM
  2. Replies: 4
    Last Post: 05-21-2012, 08:21 AM
  3. Data Not Saving To Table
    By AUS1960 in forum Forms
    Replies: 2
    Last Post: 05-11-2011, 05:35 AM
  4. Replies: 1
    Last Post: 04-19-2011, 01:55 PM
  5. Calculations in Form not saving to table
    By ld8732 in forum Forms
    Replies: 1
    Last Post: 01-24-2011, 07:31 PM

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