Results 1 to 10 of 10
  1. #1
    aligahk06 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Posts
    94

    Text Box level and unit no won't save to table field Level and unitno

    Dear All,



    The previous thread related to topic is solved .

    today i noticed that the below control source property won't save the value in table.

    Assuming you have a text box called "Level" and another called "unitno".

    Set the Control Source property of text box "Level" to =[Combo78].column(1)
    Set the Control Source property of text box "unitno" to =[Combo78].column(2)
    it working fine with combo and display the value from combo but it won't save the value in table.


    Any help !!!


  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you need to bind your textboxes to the fields in your table and use vba to assign the values - usually in the afterupdate event of your combo

    me.txtLevel=[Combo78].column(1)
    me.txtunitno=[Combo78].column(2)

    or alternatively in the form beforeupdate event

    Level=[Combo78].column(1)
    unitno=[Combo78].column(2)

    strongly recommend you give your controls meaningful names

  3. #3
    aligahk06 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Posts
    94
    after running value out of context You can't assign value to this object

    Private Sub Combo78_AfterUpdate()
    Me.Level = [Combo78].Column(1)
    Me.UnitNo = [Combo78].Column(2)
    End Sub

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    With this code you need to set the control source of the two test boxes to be the two fields from the table, not to reference the combo's columns.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    As ajax says, on the form, set the control source for the textboxes to the field names so as to bind them.
    You can't set the VALUES equal to an expression if the VBA is doing the same.

  6. #6
    aligahk06 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Posts
    94
    I want to save value from combo selection to table.
    Please see the attached DB.
    after running value out of context You can't assign value to this object

    Private Sub Combo78_AfterUpdate()
    Me.Level = [Combo78].Column(1)
    Me.UnitNo = [Combo78].Column(2)
    End Sub
    Attached Files Attached Files

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    See db Attached:
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    aligahk06 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Posts
    94
    Sir Bob Fitz,
    I can't understand the language of attached DB.

  9. #9
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by aligahk06 View Post
    Sir Bob Fitz,
    I can't understand the language of attached DB.
    I'm very sorry. Somehow I managed to attach the wrong db.
    please see attached:
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  10. #10
    aligahk06 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Posts
    94
    THanks a lot for precious time.

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

Similar Threads

  1. Linking Tables at the Table Level Vs. the Query Level
    By Tammy in forum Database Design
    Replies: 3
    Last Post: 12-03-2014, 01:34 PM
  2. Replacing numbers with text at the query level
    By lonesoac0 in forum Queries
    Replies: 4
    Last Post: 09-03-2014, 03:16 PM
  3. BUG! Field level date validation
    By buj in forum Forms
    Replies: 0
    Last Post: 09-16-2010, 08:23 PM
  4. Field Level Access
    By botts121 in forum Programming
    Replies: 0
    Last Post: 07-09-2009, 11:59 AM
  5. Field Level Date validation
    By fadone in forum Forms
    Replies: 1
    Last Post: 12-09-2005, 10:23 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