Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    10

    Unanswered: subform: you can't assign a value to this object

    I'm working with a subform within a form.

    I get the error: you can't assign a value to this object. In lamens terms.

    The form Production Log: Data Entry: Not enabled (to view data from searchable combo box)
    Vaues: Product No, Production Order No, Material, Furnace No, Loaded Date, Loaded Operator, Description

    Subform Hardness Validation: Data Entry: Enabled (This is to create a hardness validation for each record in the production log. It is also specified via relationships as a one to one so that for every product in the log, there is validation to go with it)
    Values: Worksheet No (Autonumber), Chart Unload Operator, Chart Unload Date, Hardness Required, No of samples performed, and hardness data.

    Problem: When I open the form to add data, first I go up to to the searchable combo box and pick the production order number its under. One I do that, then I can go and add a hardness validation. I click on the Chart Unload Operator, and type in something and it comes up with the error of:you can't assign a value to this object. After I click "OK" I can continue on with my buisness.

    Does anyone out there in AccessLand have a solution thanks.

    Attached: Picture of form and subform. Just to give an idea.

    Code replyed on request..
    Attached Thumbnails Attached Thumbnails fom and subform.jpg  
    -CLAYDOS

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Post the code that you're having problems with ...

  3. #3
    Join Date
    Dec 2003
    Posts
    10
    Originally posted by M Owen
    Post the code that you're having problems with ...
    I dont think its the code, but here it goes:

    for the Form:

    Private Sub Add_Record_Click()
    On Error GoTo Err_Add_Record_Click


    DoCmd.GoToRecord , , acNewRec


    Exit_Add_Record_Click:
    Exit Sub

    Err_Add_Record_Click:
    MsgBox Err.Description
    Resume Exit_Add_Record_Click

    End Sub

    Private Sub Close_Form_Click()
    On Error GoTo Err_Close_Form_Click


    DoCmd.Close

    Exit_Close_Form_Click:
    Exit Sub

    Err_Close_Form_Click:
    MsgBox Err.Description
    Resume Exit_Close_Form_Click

    End Sub

    Private Sub Department_BeforeUpdate(Cancel As Integer)
    If Me.Department = "Other" Then
    Me.Specify_if_Other2.Visible = True
    Else
    Me.Specify_if_Other2.Visible = False
    End If
    End Sub

    Private Sub Form_Load()
    DoCmd.Maximize
    End Sub

    Private Sub Material_BeforeUpdate(Cancel As Integer)
    If Me.Material = "Other" Then
    Me.Specify_if_Other.Visible = True
    Else
    Me.Specify_if_Other.Visible = False
    End If
    End Sub


    Private Sub Combo84_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Hardness Worksheet Number] = " & Str(Me![Combo84])
    Me.Bookmark = rs.Bookmark
    End Sub





    For the subform:

    Private Sub Command167_Click()
    On Error GoTo Err_Command167_Click


    DoCmd.Close

    Exit_Command167_Click:
    Exit Sub

    Err_Command167_Click:
    MsgBox Err.Description
    Resume Exit_Command167_Click

    End Sub
    Private Sub Command168_Click()
    On Error GoTo Err_Command168_Click


    DoCmd.GoToRecord , , acNewRec

    Exit_Command168_Click:
    Exit Sub

    Err_Command168_Click:
    MsgBox Err.Description
    Resume Exit_Command168_Click

    End Sub

    Private Sub Form_Activate()
    Me.Operator.SetFocus
    End Sub

    hope that is all... thanks
    -CLAYDOS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •