Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

save new record and sync subform

Posted on 2013-06-10
2
Medium Priority
?
476 Views
Last Modified: 2013-06-18
I have a button that opens a new form, inserts a clientID and saves the record to show the InvoiceID. This does not seem to be enough for the subform as when I try to add a subform record it works until I try to requery the main form using Forms![frmInvoices].Requery. This brings the entire form to a new record.

Any ideas?


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

Forms![frmInvoices].Refresh
Forms![frmInvoices].Dirty = False

Open in new window


Q_28152753.html
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
2 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 39235095
In my response to your previous post, I removed the "Refresh" line, as it will do nothing for a new record, get rid of it.

In your previous post, you said nothing about a "sub-form", the code you provided above opens "another" form, not a sub-form.

Please explain (no code) what you want to do with this 'pop-up' data entry form "frmInvoices".  From your previous post, I assumed that you wanted to create a new record and save it, but I was a bit surprised that you wanted to save it without entering any of the invoice information.
0
 
LVL 1

Author Comment

by:Shawn
ID: 39235125
ok, hope this is clearer....
I create a new invoice by choosing a client in a popup window. The new invoice is created and the clientID is inserted. Works fiine up to here. In the subform I add products, prices, etc. This also works...until the after update which triggers an sp to total the products and insert/update main form with totals. If I start the procedure with a main form requery this doesn't work as it shows the InvoiceID as Null.

I did however just get it to work by switching from Requery to refresh. So I suppose I have the solution it would however be nice to better understand the workings of a new record and why requery would have this behaviour.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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 …
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…

618 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