Group:  Microsoft Access ยป microsoft.public.access
Thread: subform info retrival

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

subform info retrival
Ian 30.09.2006 22:29:02
I have 2 tables with a one-to-many relationship with a common uniqueID
connecting them. From the main table there is a main form with a command
button to open a second form. In the second, there is info from the main
form table (name, address, etc...) to help with identificaiton. I want the
second from to retrieve the uniqueID from the first form so it will grab the
rest of the info. How do I set form2 unique ID to be equal to form1 uniqueID?
RE: subform info retrival
Ken Sheridan 30.09.2006 22:55:01
Filter the second form to the current form's ID when you open it from the
button on the first form, e.g.

DoCmd.OpenForm "YourSecondForm", WhereCondition:= "UniqueID = " & Me.UniqueID

This assumes UniqueID is a number data type if its text you'd use the
following, wrapping the value in quotes:

DoCmd.OpenForm "YourSecondForm", WhereCondition:= "UniqueID = """&
Me.UniqueID & """"

Ken Sheridan
Stafford, England

"Ian" wrote:

[Quoted Text]
> I have 2 tables with a one-to-many relationship with a common uniqueID
> connecting them. From the main table there is a main form with a command
> button to open a second form. In the second, there is info from the main
> form table (name, address, etc...) to help with identificaiton. I want the
> second from to retrieve the uniqueID from the first form so it will grab the
> rest of the info. How do I set form2 unique ID to be equal to form1 uniqueID?

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net