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.
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 -
-
Private Sub CommandXX_OnClick()
-
Dim stDocname As String
-
Dim stLinkCriteria As String
-
-
stDocName = "Your second form"
-
stLinkCriteria = "[ID Field on Form2]=" & Me.[ID Field on Form1]
-
-
DoCmd.OpenForm stDocName, , , stLinkCriteria
-
-
End Sub
-
-
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.
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). -
-
Dim strSQL As String
-
-
strSQL = "UPDATE Visit SET Visit.FieldName=#" & txtVisit2 & "# WHERE Visit.OtherFieldName=<Something>;"
-
DoCmd.RunSQL strSQL
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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...
|
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'...
|
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"
|
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
| |
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
|
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,...
|
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
|
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...
|
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();
}
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |