473,586 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form that updates another form

19 New Member
Hi, I have been playing around with various forms and have asked some previous questions on this topic, but thought it best to start a new thread since my forms structes have changed if anyone can help I am almost there.

I have two forms
Form 1 =Detail
Form 2 =DetailUpdate (the fields in this form are bound to a table OrderDetailUpda te)

Detail displays information based on a combo box look up in a datasheet view from a table OrderDetail, the look up value is OrderNumber. I have a command button that opens the form in DetailUpdate , also a datasheet view and I want the data from Detail that is displayed to carry over to DetailUpdate. Form 1 has fields OrderNumber and PartNumber and I put code in the command button to put those fields into Form 2, this works but it only populates the first row and most times Form 1 has multiple lines on it. I was thinking if there was a way to instruct the code to append the data of all records from Form 1 to 2.


This is what I have right now:
////////////////////////////////////////////////////////////////////////////////////////
Expand|Select|Wrap|Line Numbers
  1. Private Sub OpenOrderUpdateForm_Click()
  2. On Error GoTo Err_OpenOrderUpdateForm_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "frmDetailUpdate"
  8.  
  9.        DoCmd.OpenForm stDocName
  10.     Forms!frmDetailUpdate!OrderNumber = Me.OrderNumber
  11.     Forms!frmDetailUpdate!PartNumber = Me.PartNumber
  12. Exit_OpenOrderUpdateForm_Click:
  13.     Exit Sub
  14.  
  15. Err_OpenOrderUpdateForm_Click:
  16.     MsgBox Err.Description
  17.     Resume Exit_OpenOrderUpdateForm_Click
  18.  
  19. End Sub
/////////////////////////////////////////////////////////////////////////////////////////////
This updates the first line, but that is all. Might be a simple answer, but I sure can't figure it out. Any help would be appreciated.

Thanks Mark.
Mar 13 '07 #1
7 1709
NeoPa
32,566 Recognized Expert Moderator MVP
Mark,
This is another example of where people will find it difficult to help. Your explanation makes it hard to understand what you're after. When you talk about sending something to another form, that's hard to understand as forms don't really store anything at all. They simply show data from a table or a query. Perhaps you could try to redo the question (in this thread) paying particular attention to making it clear what you're after.
Mar 17 '07 #2
mtrcct
19 New Member
Neo, I understand what you are saying and let me try to re-phrase.

I am building a purchasing database that the user enters requisition information in a table DetailHeader and Detail all from one form that I built and that works fine.

Now I am trying to build a form that takes the previously entered information from the Detail table and add the addtional purchase order information to each line so the user does not have to enter the information a second time.

I have a combo box that fills the form Detail when the user selects a requision number from table Detail and I want to take this information and move it to another form that is bound to the table DetailUpdate.

The code I posted above opens the form DetailUpdate via a command button and works for just one line, but does not increment the rows to match the results displayed that are currently displayed in the Detail form. Basically, I am trying to clone the form Detail but make it bound to another table.

I understand that a form displays data from a table, but was thinking if I could throw that result to another form it would make the data entry so much easier.

Thanks for the feedback and I hope this makes more sense.

Mark.
Mar 19 '07 #3
NeoPa
32,566 Recognized Expert Moderator MVP
I'm sorry Mark.
This makes little more sense to me. I can't give you an answer to this question.
I can't even tell you how you should write the question as I can't tell what you want. I don't mean to criticise so I'll just step back and leave you to decide how best to play it from here.
Mar 19 '07 #4
mtrcct
19 New Member
Neo, no offense taken.
I need to put this english so as not to waste any more of the experts time here. Thanks for your support, the forum is great. I am learning a lot just from reading responsed to questions that others have posted.
Mar 20 '07 #5
NeoPa
32,566 Recognized Expert Moderator MVP
I'm pleased you feel that way Mark.
I'll catch anything else you post here now so I'll see what I can do if you repost :)
Mar 20 '07 #6
Denburt
1,356 Recognized Expert Top Contributor
Hmmm let see if this will help you.


Expand|Select|Wrap|Line Numbers
  1. Private Sub OpenOrderUpdateForm_Click()
  2. On Error GoTo Err_OpenOrderUpdateForm_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6. Dim db as database
  7.     Dim rs as recordset
  8.     Dim rs1 as recordset
  9.  
  10.     stDocName = "frmDetailUpdate"
  11.  
  12.        DoCmd.OpenForm stDocName
  13. set db = currentdb
  14. set rs = me.recordsetclone
  15. set rs1 = db.openrecordset("OrderUpdate")
  16. If not rs.eof then 
  17. Do until rs.eof
  18. rs1.edit
  19. rs1.addnew
  20.  
  21.     rs1!OrderNumber = Me!OrderNumber
  22.     rs1!PartNumber = Me!PartNumber
  23.  
  24. rs1.update
  25. loop
  26. end if
  27. rs1.close
  28. rs.close
  29. set rs1 = nothing
  30. set rs = nothing
  31. set db = nothing
  32. Exit_OpenOrderUpdateForm_Click:
  33.     Exit Sub
  34.  
  35. Err_OpenOrderUpdateForm_Click:
  36.     MsgBox Err.Description
  37.     Resume Exit_OpenOrderUpdateForm_Click
  38.  
  39. End Sub
  40.  
Typing off the cuff here so I hope I didn't I miss anything.
Mar 20 '07 #7
mtrcct
19 New Member
Denburt, thanks for the info! I'll give it a try and let you know....

Mark.
Mar 23 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2219
by: Noozer | last post by:
We have a web based tool used to report issues in our office. Many times the users do not enter the required information to deal with the issue. Unfortunately we don't have control of this application to update or modify it. I would like to create another web based tool where users would fill out a form, click submit and the info from that...
1
2192
by: Bill Strass | last post by:
Problem: Access main form/subform as front end to SQL Server backend. Add/edit via subforms work fine. Not so with main form. Set up a master-detail form-subform using two views linked from SQL Server. The subform allows inserts an updates, while the main form will not. The only solution I can think of is to recreate using tables imported...
13
7464
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on it, a frontend and a backend. Case 1: If vba code on the frontend updates many rows (360,000) on the backend, a form's timer event (from the...
3
7387
by: Brian Keating EI9FXB | last post by:
Hello again, I've already placed a few posts on this topic. This time i've a simple application that exhibits my problem, I've placed sample solution 8k on my website should anyone be interested in having a look. http://briankeating.net/transfer/test.zip To recap the problem I expected (and found). I've a main GUI thead (main form), this...
3
1343
by: Tim | last post by:
Hi, I have have a program containing two forms that are open at the same time. The main form updates the second when the user enters input by adding a control to it. My problem is that when the second form (which is in the backgroud) is updated it suddenly jumps to the top of the z-order although it does not have focus. Is there any way...
14
1919
by: bchi49 | last post by:
I'm having problem updating a form that queries from 3 tables. When I update the foreign key it tries to update the PK on the foreign key table which it shouldn't. I'm using MS Access 2003 connected to SQL Server 2000. Here's an example: Tables: T1, T2, and T3. T1 links to T2, and T2 links to T3.
3
11077
by: Brian | last post by:
I have a form that has a textbox used to search records in a table. On the form I have a listbox which shows each record in the table. When you click on each row in the listbox the rest of the form updates to show the other fields in the table. The problem I am having is when I enter text to search the table the list narrows successfully,...
6
2940
by: ortaias | last post by:
I have a listbox which can display all records or provide a limited list based on a filter derived from an optiongroup. The code works except in the one situation where the listbox filter is changed. The problem appears to be "Me..Selected(1) = True" which triggers (sporadically) the click event for List7. The net effect is that when I...
5
3581
by: wktarin | last post by:
Hi. I'm a relative newcomer to the world of php, and I keep bumping into a problem with a mail () form. I need to send an automatic email to two addresses, but I can't seem to get it to work. One email address works just fine, but I can't get the email sent to two different addresses no matter what I try. Below is my code. If someone could help me...
0
7912
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8202
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6614
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.