Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem in subform except when view is datasheet (2007)

    I have a strange problem in my subform.
    When the subform is "Continuous Forms", i can not change the value of one field.
    When I let the subform shown as "datasheet", I do not have that problem, i can change the value of that one field.
    Does any one already had the same problem?

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

    Re: problem in subform except when view is datasheet (2007)

    That doesn't ring a bell. Could you attach a stripped down and zipped copy of your database? See <post#=401925>post 401925</post#> for instructions.

  3. #3
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: problem in subform except when view is datasheet (2007)

    Hello,
    I have uploaded my db.
    When you open the form "frmfacturatie", via the combobox select the invoice.
    On the second tab you'll find a subform for artikels.
    In the field "aantal" it is not possible to change the value.
    But when i put that subform in datasheet view, I can change the value.
    Attached Files Attached Files

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

    Re: problem in subform except when view is datasheet (2007)

    I don't have Access 2007 so I can't open a database in .accdb format. Could you convert the database to .mdb format, zip it and attach that? Thanks in advance.

  5. #5
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: problem in subform except when view is datasheet (2007)

    Hello i converted the db, i don't know if it still works now.
    It could be that in 2003 the problem does not excist.
    Attached Files Attached Files

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

    Re: problem in subform except when view is datasheet (2007)

    The problem is caused by the On Change event procedure. This event fires every time the user types something in the field. Instead of the On Change event procedure, you should use the After Update event.

    And you shouldn't use DoCmd.Save. This doesn't save the record, but the design of the form - there is no need to do that.

  7. #7
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: problem in subform except when view is datasheet (2007)

    Maybe a stupid question, what is the command to save the record then? I've tried recordset.save, but that does not work either.
    i have changed my code on "after udpate" and yes it works now.
    Thanks

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

    Re: problem in subform except when view is datasheet (2007)

    I don't think you should save the record after each change to a field. Access will save the record when you move to a different record or when you close the form.
    But if you need to save a record explicitly, the instruction is

    RunCommand acCmdSaveRecord

  9. #9
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: problem in subform except when view is datasheet (2007)

    Ok thanks very much <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>, you are an <img src=/S/angel.gif border=0 alt=angel width=15 height=21>

Posting Permissions

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