Results 1 to 6 of 6
  1. #1
    TinaH is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    12

    Error on Required Field that has a Value

    I created a Form based on the table COMPLAINT for the field COMPLAINT_STAT_ID I created a lookup to refer to the V_COMPLAINT_SCR selecting the COMPLAINT_SRC_ID and the COMPLAINt_SRC_DESC and selected that the value be stored in the COMPLAINT_STAT_ID field of the COMPLAINT table. On the form I created an unbound text box (named txtREFRD_BY) and used the COMPLAINT_STAT_ID field as my combo box and named it cboREFRD_BY because the V_COMPLAINT_SRC table holds information on who referred the compainant to this office.
    The code behind cboREFRD_BY after update is

    Private Sub cboREFRD_BY_AfterUpdate()


    Me.txtREFRD_TXT.Value = Me.cboREFRD_BY.Column(1)
    End Sub

    Which works to populate the field COMPLAINT_STAT_ID and the unbound text field txtREFRD_BY

    I have checked the field lengths numerous times and have tested it. On close I make sure that I compact and repair the database however, when I turn it over to the person testing the database they get the following error and when I go back and open the database I also receive the same error.

    File AttactedError 1.zip

    When I exit out of this error, I then receive an error stating that COMPLAINT_STAT_ID is required. The issue is that COMPLAINT_STAT_ID has a value in it.

    What is happening?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    You say the textbox is unbound and named txtREFRD_BY. So why does the code refer to txtREFRD_TXT? Why use VBA? Expression in textbox ControlSource can be: [cboREFRD_BY].[Column](1).

    Post the combobox RowSource SQL statement.

    COMPLAINT_SRC_ID and COMPLAINT_STAT_ID fields are autonumber/number type?

    Did you set lookup in table? I NEVER do that. http://access.mvps.org/access/lookupfields.htm
    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
    TinaH is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    12
    Sorry, the unbound text box is named txtREFRD_TXT


    Quote Originally Posted by June7 View Post
    You say the textbox is unbound and named txtREFRD_BY. So why does the code refer to txtREFRD_TXT? Why use VBA? Expression in textbox ControlSource can be: [cboREFRD_BY].[Column](1).

    Post the combobox RowSource SQL statement.

    COMPLAINT_SRC_ID and COMPLAINT_STAT_ID fields are autonumber/number type?

    Did you set lookup in table? I NEVER do that. http://access.mvps.org/access/lookupfields.htm

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    That doesn't respond to my other questions/request. Review the post again.
    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
    TinaH is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    12
    Yes, I set lookup in the the table.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Do you want to provide response to:

    Post the combobox RowSource SQL statement.

    COMPLAINT_SRC_ID and COMPLAINT_STAT_ID fields are autonumber/number type?
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-07-2012, 02:14 AM
  2. required field error
    By sireesha in forum Forms
    Replies: 7
    Last Post: 12-06-2012, 01:23 AM
  3. Object Required Error
    By sgp667 in forum Programming
    Replies: 1
    Last Post: 11-06-2012, 03:15 AM
  4. Error: Object Required
    By compooper in forum Programming
    Replies: 6
    Last Post: 06-22-2011, 07:52 AM
  5. Object Required Error.
    By Robeen in forum Forms
    Replies: 1
    Last Post: 03-28-2011, 10:30 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