Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, CA, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New Record Error (2002)

    I have a series of subforms and tabcontrols on the last subform When I try to create a new record I get an error when I enter data in the companyname control but then when I click on the dialog box I can then continue entering data.
    The Main form is: 60300-frmJobCost-MainForm
    On this form is TabJobCost
    The tab is pgJobLog.
    The page is pgJobLog
    On this tab is a subform 30100-frmJobLog-MainForm-Tab
    Within this subform is TabJobLog
    The tab pgEntries has a subform 30200-frmJobLog
    On this subform are various control including CompanyNamez.
    There is a button on this form btNewCustomer.
    The code for this button is:

    Private Sub btNewCustomer_Click()

    DoCmd.GoToRecord , , acNewRec
    DoCmd.GoToControl "CompanyNamez"
    DoCmd.SetWarnings False

    Exit_btNewCustomer_Click:
    Exit Sub

    Err_btNewCustomer_Click:
    MsgBox Err.Description
    Resume Exit_btNewCustomer_Click

    End Sub

    I've tried to transverse down the forms but still get this error message You can't assign a value to this object read only too large data etc,
    Frank <img src=/S/bash.gif border=0 alt=bash width=35 height=39>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: New Record Error (2002)

    Some things to check:
    <UL><LI>Has each subform been linked correctly to its parent by setting the master and child link fields?
    <LI>Is the record source of each subform updateable?
    <LI>Does the record source of the JobLog subform expect a field to be filled in before a company name can be entered?
    <LI>If you enter data after clicking OK in the error message, does the new record get linked correctly? You can check this by going to another record in the main form, then going back. Is the new record you just created still visible in the subform?[/list]I'm aware that these suggestions are rather vague, but it's difficult to know what's happening in such a complicated structure without actually seeing it.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, CA, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: New Record Error (2002)

    Has each subform been linked correctly to its parent by setting the master and child link fields?
    ================================================== =========================
    Yes
    ================================================== =========================
    Is the record source of each subform updateable?
    ================================================== =========================
    Yes
    ================================================== =========================
    Does the record source of the JobLog subform expect a field to be filled in before a company name can be entered?
    ================================================== =========================
    CompanyID
    ================================================== =========================
    If you enter data after clicking OK in the error message, does the new record get linked correctly?
    ================================================== =========================
    Yes
    ================================================== ==========================
    You can check this by going to another record in the main form, then going back. Is the new record you just created still visible in the subform?
    ================================================== ==========================
    I tried setting Warnings off and still get the dialog box as soon as I enter the first character in companyname.
    I think it's got something to do with that CompanyID is not created before companyname is entered with data.
    Frank

Posting Permissions

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