Solved

save new reecord

Posted on 2013-06-10
3
213 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 (Access MVP) 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

751 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