473,505 Members | 16,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy data from one form to another and create a new record to add data

Ok, here's the outline:

I have a form called frmOrders, which has a subform (frmOrderDetails)
and another form called frmProducts.

In frmOrderDetails, when I double-click on a field called ProdDescrip
it opens frmProducts, which gives me a product list and it's prices.
When I double-click a product, automatically add the products to the
frmOrderDetails fields ProdDescrip and UnitPrice. But I can't save the
record in frmOrderDetails and move to a new one so I can add more
products.

This is the code on frmProducts

Private Sub ProductName_DblClick(Cancel As Integer)

Forms![frmOrders]![frmOrderDetails]![ProdDescrip] = [ProductName]
Forms![frmOrders]![frmOrderDetails]![UnitPrice] = [ProductPrice]

I've already tried with SaveRecord, GetFocus, and nothing seems to
work.

Any suggestions?

Nov 13 '05 #1
4 2556
Do you get an error message when you try to save your order details
record? If so, what is it?

Bruce

Nov 13 '05 #2
There's no error... it only stays in the same record on the subform.

I've tried with this:

Private Sub ProductName_DblClick(Cancel As Integer)

Forms![frmOrders]![frmOrderDetails]![ProdDescrip] = [ProductName]
Forms![frmOrders]![frmOrderDetails]![UnitPrice] = [ProductPrice]
DoCmd.RunCommand acSaveRecord
DoCmd.RunCommand acRecordGoToNew

But it saved the record and create a new one on the frmProducts, not
the frmOrderDetails subform.

Nov 13 '05 #3
Try replacing your DoCmd...SaveRecord with either

Forms!frmOrders!frmOrderDetails.Form.Dirty = False

or

Forms!frmOrders!frmOrderDetails.Form.Refresh

provided that the Order Details subform object on frmOrders has the
same name as its source form (frmOrderDetails).

Bruce

Nov 13 '05 #4
I got to save the record. But how do I get to create automatically a
new record on the subform (frmOrderDetails)? 'Cause the goal is to add
automatically products to the subform by double-clicking on the
ProductName field of frmProducts.

Richie

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4125
by: Iain Miller | last post by:
Struggling a bit here & would be grateful for any help. I have a table which has a list of people in it. Each person has a unique ID automatically allocated by Access but also belongs to one of 5...
3
8337
by: Tlm | last post by:
Hello All, I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also has a subform embedded in it (SubFrmC) The form's recordsource is based on a table (TblA). SubFrmB's...
5
2656
by: Daniel Tan | last post by:
Are there anyway to copy rows of records from one query to another query and then hide the records in source query ? Pls advise. Thanks. Regards, Daniel
1
2544
by: Sean Howard | last post by:
Dear All, As is my want I need to do something in Access that seems simple but cannot fathom out. I have main form with two subforms, both datasheets with an almost identical table structure....
1
2777
by: SuffrinMick | last post by:
Hi All I have two tables: tblRecords and tblOptions. tblRecords consists of RecordID (autonumber), Record (text) and Option (text record of options chosen) fields tbloptions consists of...
3
3198
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data....
19
3442
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
2
3445
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have...
3
9225
by: Richnep | last post by:
Hi all, I have tabbed subforms where I need to copy one field value from one subform over to another subform. Although I can run an update query to accomplish this I would like to do it through...
1
1730
by: chrisdavis | last post by:
I have a submission form with data in it that is submitted into "tblSubmitter" with basic information. I need to take every third record and mark a "status" to it. For Example: (these are...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.