Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

save new reecord

Posted on 2013-06-10
3
Medium Priority
?
227 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
ID: 39234902
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 49

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 39234931
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
ID: 39234968
worked perfectly. Exactly what I needed. thank you
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

927 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