473,662 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relating forms (newbie)

2 New Member
Using Access 2000, how does a record chosen on one form get transferred to another form? A user choses a record in form 1, and presses a button which opens form 2. I want to work with that record in form 2 but with data from a 2nd, related table. The tables are all related with one to many relationships.

Is there a sql join statement that needs to go behind an event procedure or something?

Thanks for any ideas.
Oct 27 '06 #1
3 1365
MMcCarthy
14,534 Recognized Expert Moderator MVP
Using Access 2000, how does a record chosen on one form get transferred to another form? A user choses a record in form 1, and presses a button which opens form 2. I want to work with that record in form 2 but with data from a 2nd, related table. The tables are all related with one to many relationships.

Is there a sql join statement that needs to go behind an event procedure or something?

Thanks for any ideas.
Set the recordsouce of the second form to return ALL relevant records

Then when opening the form using the on click event change the code to

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub CommandXX_OnClick()
  3. Dim stDocname As String
  4. Dim stLinkCriteria As String
  5.  
  6.   stDocName = "Your second form"
  7.   stLinkCriteria = "[ID Field on Form2]=" & Me.[ID Field on Form1]
  8.  
  9.   DoCmd.OpenForm stDocName, , , stLinkCriteria
  10.  
  11. End Sub
  12.  
  13.  
Oct 28 '06 #2
BirdByte
2 New Member
Thanks very much. In debug mode I saw that the ID field did get passed, but I kept getting an 'enter parameter' box, and couldn't figure out where or what the expression was that it was looking for (I'm assuming I had a faulty query behind the record source, but I'm really not sure).

I got around that by using this behind the OnClick event: DoCmd.OpenForm "myForm", acNormal, , "UserID = '" & UserID & "'", , , UserID

10 additional text boxes get populated behind the myForm OnCurrent event: txtVisit2.Value = DateAdd("m", 6, Me.OrigDate)

How can I update the 'Visit' table with the new values in the 10 txtVisit boxes. I tried adding the table to the control source and binding the text boxes, but that didn't work, neither did binding behind a different event (LostFocus specifically).

Thanks for any guidance and your patience with a newbie.
Oct 30 '06 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP

10 additional text boxes get populated behind the myForm OnCurrent event: txtVisit2.Value = DateAdd("m", 6, Me.OrigDate)

How can I update the 'Visit' table with the new values in the 10 txtVisit boxes. I tried adding the table to the control source and binding the text boxes, but that didn't work, neither did binding behind a different event (LostFocus specifically).
Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim strSQL As String
  3.  
  4. strSQL = "UPDATE Visit SET Visit.FieldName=#" & txtVisit2 & "# WHERE Visit.OtherFieldName=<Something>;"
  5. DoCmd.RunSQL strSQL
  6.  
  7.  
Oct 30 '06 #4

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

Similar topics

2
5315
by: Henro V | last post by:
Can I integrate 3 existing forms (all based on the same query) integrate in one form by using Tab's? Thanx for thinking, Henro
19
4091
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
6
1468
by: AMeador | last post by:
I have a form where a user will check boxes next to items that have been completed. They will click a button on the form to mark the items as completed. When they do this, I will have the 'parent' form instantiate another form where the details of this completed event will be entered. Once the data is entered on this 'child' form, the data entered should be updated/added to the database. The 'child' form also has 'Cancel' and 'Cancel All'...
3
2461
by: qwerty | last post by:
I´m new to ASP.Net. My workmate has some experience with it. He claimed that in ASP.Net working with frames is much simpler than it was ASP. I asked explanation but he couldn't give me such. (a button inside a-tag with attribute target isn't anything new relating ASP.Net, its same old HTML). He claimed that you could change another page´s controls´s property´s value from another frame by using this method: ' Page "Bottom"
2
994
by: Mr Newbie | last post by:
I am writing an application in which I have configured Forms Authentication. However, it never seems to time out. I thought the default was twenty minutes. I am wondering if the Persisatnt Cookie=True is the reason for this, Im going to try it but can someone validate this please. -- Best Regards
2
1573
by: Pink | last post by:
Hi I am a Newbie to .Net can anyone let me know the diffrence between Windows.Forms and Winforms they are different version of totally different and are some methods different too Thanks
2
3672
by: Eric A. Johnson | last post by:
Hi All, I'm sure this is a newbie problem... but after all, I am a .NET newbie. I'm trying to use MessageBox.Show, according to my book. It tells me to use "Imports System.Windows.Forms". I can import System just fine, but it won't (or can't) find the .Windows portion; therefore, I cannot use MessageBox. Is there an option somewhere within VS.NET 2002 that I can change to let it import properly? I am at my wit's end regarding this,...
7
2013
by: AdeelAlvi | last post by:
iam working on a project called service desk that automates the departmental services online .one major component i have to create is that to convert paper based forms into dynamic webforms . i want to design a module that will create dynamic web forms that will convert paper based forms into webforms. help required ... thankx in advance -- Regards Adeel Alvi
12
11074
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
4
1212
by: bob | last post by:
Hi, Newbie question. I have a logon Web Form which, once the server has validated the logon, I want to open up a main form. i.e. In a windows app I would write something like if(logon) { frmMain f = new frmMain(); f.show(); }
0
8343
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8762
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.