Results 1 to 6 of 6
  1. #1
    djspod is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    164

    Form Textbox fed values from another textbox but not added to table as a recordset?

    Hi,

    I have form which is bound to a table, most of form items populate records in the table fields other than 2 table fields that are fed values within the form via vba.
    These fields remain blank?

    I know I am missing something somewhere that's probably straight forward but what?

    Can anyone help please

    Thanks



    Darren

    Sent from my SM-G935F using Tapatalk

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Can we see some code which you think should be working?


    Sent from my iPhone using Tapatalk

  3. #3
    djspod is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    164
    Hi ,

    I have added the DB and a screenshot.

    The fields highlighted with a red rectangle box are the fields that don't add to the table for some reason?

    Thanks

    Darren
    Attached Thumbnails Attached Thumbnails DB Screenshot.jpg  
    Attached Files Attached Files

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    To save the data displayed in a form control to a table field that control would need to have its Control Source property set to the name of the field in the table.
    If the data displayed is "calculated" with vba code or in the forms underlying query it might be better not to save the result but better to recalculate it whenever and wherever it is needed
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I agree with Bob.

    For the control "ProductDesc" (Product Description), the control source is a calculation. Effectively, the control is unbound.

    For the control "text3" (Producing Site), the control is unbound. ("Text3" is a bad control name)
    (An unbound control is a control that is not bound to the form record source.)

    You will have to come up with a method to save the values to the table.

    I would bind the controls to their respective fields.
    Then, for the Product Description (control name "ProductDesc"), I would use the after update event of the control "cboLineNo" to calculate and push the calculation into the "ProductDesc" control.

    And for the Producing Site (control name "text3"), all you need to do is bind the control to a field. There is already code to push a value into the control.



    And I would suggest you change the look up FIELDS in table "tblQualityReportData" to standard (non lookup) fields.
    See
    The Evils of Lookup Fields in Tables
    http://access.mvps.org/access/lookupfields.htm

    The Ten Commandments of Access
    http://access.mvps.org/access/tencommandments.htm

  6. #6
    djspod is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    164
    Hi All,

    Thanks for your constructive and useful comments.

    I remember seeing that Lookup issue before (Evils of Lookup via tables) but had forgotten about this good tip.

    I take on board the information supplied.

    I will reword text3 and bind to a table control, for the other CBO, I'll create a qry and use a cascading combo effect but at the same time bind to a table control field.

    It looks like the answer was staring me in the face!

    Thanks for the help guys

    Darren

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

Similar Threads

  1. Replies: 8
    Last Post: 01-31-2017, 06:14 PM
  2. Replies: 2
    Last Post: 12-22-2015, 09:09 PM
  3. Replies: 5
    Last Post: 04-30-2015, 01:50 AM
  4. Replies: 2
    Last Post: 08-12-2013, 05:47 PM
  5. Replies: 2
    Last Post: 02-04-2012, 01:48 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