Solved

save new reecord

Posted on 2013-06-10
3
201 Views
Last Modified: 2013-06-10
I have a button that opens a new form, inserts a clientID and now I need it to save or refresh. It is for an invoice app and I need the InvoiceID to show (sql server ID identity).

How can I do this?

DoCmd.OpenForm "frmInvoices", acNormal, , , acFormAdd
Forms![frmInvoices]![ClientID] = Me.ClientID
[frmInvoices].Form.Requery

Open in new window

0
Comment
Question by:Shawn
3 Comments
 
LVL 2

Expert Comment

by:babuse
Comment Utility
Not sure if I am completely understanding.
Are you just wanting to refresh the form?

Add the Me.refresh command.
Here is a link that describes it a little more.

http://www.599cd.com/tips/access/requery-v-refresh/
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
Comment Utility
If you want to save the record, via VB, immediately after assigning the ClientID, try:

DoCmd.OpenForm "frmInvoices", acNormal, , , acFormAdd
Forms![frmInvoices]![ClientID] = Me.ClientID

Forms![frmInvoices].Dirty = False  '<===  This forces a record save
0
 
LVL 1

Author Closing Comment

by:Shawn
Comment Utility
worked perfectly. Exactly what I needed. thank you
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now