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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.