Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2014
    Posts
    2

    Autofilled values through combobox are not getting saved..

    Hi



    I have 2 tables
    Staff table = has 3 columns = Staff id, name , department
    Nominations = has 4 columns = Staff id, name, department, class name,

    I have created a form...when the person goes to the combobox, it is popultated with the staff ids from the staff table..This is correct.
    I chose one of those ids.
    The Name and department fields are also populated automatically.
    I then write the class name

    Now, when i click on "add record" button, the record should be updated in the nominations table. There should be 4 new values in the nominations table (Staff id, name, department and the class name)

    BUT
    For some reason,
    Only Staff id and Class name are getting saved.
    Name and department are not getting saved.

    Why is it so?
    Please help me out..

    This is my 1st week of using access..so please be kind enough to keep the solutions and the instructions easy to follow.

  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,642
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Apr 2014
    Posts
    2
    Quote Originally Posted by pbaldy View Post
    I did follow this also
    "
    If your situation is that rare one where saving the related info is necessary, you'd use the same combo. In the textbox, instead of the formula as the control source, you'd list the field in the Orders table where you wanted the phone number saved. In the after update event of the combo, you'd have code like this to copy the value over:

    Me.TextboxName = Me.ComboName.Column(2)
    "


    i listed the field as [nominations].[name]
    and i updated the after event of the combo

    but it gave an error like "Me is unrecogonized....." something something.
    Was i not supposed to write "Me"??
    i wrote Me.name = me.combostuffid.column(1)

  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,642
    Me is only valid in VBA code. Did you put that code in the VBA editor?

    http://www.baldyweb.com/FirstVBA.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. How to set Parameter values for a saved query via VBA?
    By lookingforK in forum Programming
    Replies: 8
    Last Post: 07-02-2013, 01:24 PM
  2. Combobox setting other combobox values problem
    By maxmaggot in forum Programming
    Replies: 8
    Last Post: 06-30-2013, 07:18 AM
  3. 1 Combobox with values from 2 tables
    By Comsoft in forum Access
    Replies: 1
    Last Post: 04-23-2013, 05:42 PM
  4. ComboBox not listing values
    By tylerg11 in forum Access
    Replies: 1
    Last Post: 09-23-2011, 10:28 AM
  5. Values in a combobox
    By kbp in forum Access
    Replies: 2
    Last Post: 02-01-2011, 03:53 AM

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