access 2007 save or close question

dbse uploaded
go to form called clients
go to first tab called main detaills
when I enter a new clients detailsnin the form the only way the new record is saved is when
I close the whole form and go into it again.

I tried a save button (to the right of the page) but it doesnt seem to work

there is a design issue here with save. What am  doing wrong?

On a more general note would there be a better way to enter new clients details say a pop up form.

current.accdb
topUKlawyerAsked:
Who is Participating?
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Your Save button doesn't reference the Subform you intend, it would seem. YOu'd need to use code like this:

Me.maincontent.form.Dirty = False

Note that the name of your Subform Control was "=sum[invoices", which i assume is a mistake. I changed it to "mainclient"

As to a better way: No, I don't think a popup would be better. Access can handle adding new records on bound forms quite easily, and I'd encourage you to stay with the expected and default behavior for these operations.

0
 
topUKlawyerAuthor Commented:
Thanks.

Not clear from your comment where the Me.maincontent.form goes

nor what you are referring to by "maincontent"  in that code.

0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You'd add code like this in the Click event of your button. Do away with the embedded macro and add code directly using the Event Procedure.

Your Subform CONTROL (i.e. the control on the mainform that hosts your subform) was named "=sum[invoices" ... that's obviously not what you intended on nameing it (at least I hope), so I changed it to be named "maincontent". Just open your form in Design view, and click ONCE on the subform on your Main Detail page, then check the Properties for that item. You'll find the Name property as I indicated, and change it to "maincontent"
0
 
topUKlawyerAuthor Commented:
Thanks so much


when you say you changed did you attach it back to me?

cos I cant see any changes

0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
No, I didn't change it. You can make the changes quite easily - try it, and if you run into troubles let us know.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.