Solved

save new reecord

Posted on 2013-06-10
3
208 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 47

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access Report Expression 4 26
Slow running query - help 16 36
MS Access Query Question 2 34
Union & Crosstab qrys 101! 6 56
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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 …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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