updating subform 
Author Message
 updating subform

I have a form containing one linked subform.

For the main form, I use a "before update" procedure to write the current
date "now()" into a field in the current table labeled "LastUpdated."

However, whenever I update info in the related subform, the LastUpdated
field does not get updated.  How do I get that to work?

Thanks.

--
Bill

PhotoSourceFolio webmaster
http://www.*-*-*.com/



Fri, 18 Jul 2003 11:10:15 GMT  
 updating subform
Are you expecting activity in the subform to update a value in the Main form
or in the subform?
You would need code in the subform Before Update event to update the field
on the main form.

Duane


Quote:
> I have a form containing one linked subform.

> For the main form, I use a "before update" procedure to write the current
> date "now()" into a field in the current table labeled "LastUpdated."

> However, whenever I update info in the related subform, the LastUpdated
> field does not get updated.  How do I get that to work?

> Thanks.

> --
> Bill

> PhotoSourceFolio webmaster
> http://www.photosourcefolio.com



Fri, 18 Jul 2003 11:38:59 GMT  
 updating subform
In the AfterUpdate event procedure of your subform:

    With Me.Parent
      .LastUpdated = Now()
      .Dirty = False
    End With

I'd suggest different name for this field, though: LastUpdated is
a property of DAO recordsets.

Quote:

> Are you expecting activity in the subform to update a value in the Main form
> or in the subform?
> You would need code in the subform Before Update event to update the field
> on the main form.

> Duane



> > I have a form containing one linked subform.

> > For the main form, I use a "before update" procedure to write the current
> > date "now()" into a field in the current table labeled "LastUpdated."

> > However, whenever I update info in the related subform, the LastUpdated
> > field does not get updated.  How do I get that to work?

--
Perth, Western Australia
Tips for MS Access users at:
        http://odyssey.apana.org.au/~abrowne


Fri, 18 Jul 2003 12:59:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Updating subform data

2. Update subForm

3. updating a field in a form from a subform

4. Subform update

5. updating the contents of a subform from an unbound listbox

6. Subform reference error Update

7. Subform not updating help!

8. Access 97 - Subform access triggers update for Main Form

9. Update list based on Subform.

10. Having Subform update all rows

11. Referencing a field on a SubForm within a Subform

12. Control name of subform from code behind subform

 

 
Powered by phpBB® Forum Software