Solved

save new reecord

Posted on 2013-06-10
3
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 48

Accepted Solution

by:
Dale Fye earned 500 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

626 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