Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2006, 05:14 AM
Authorized User
 
Join Date: Apr 2006
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default Open a subform from a form

Hi all,
I have a little problem.
There is a form which includes a subform with common field ID!
Each form has a Last Name such:
MAIN FORM:ID 411
          LAST NAME: Smith

SUB FORM:ID 411
          LAST NAME: Lee

Now I created a third form with a field which includes a list of all the names, from main and sub form!
I d like in this form (third form) when I'm selecting a Last Name to I'm push a button and open the main form even though the name I have selected is from the subform

 
Old May 3rd, 2006, 08:25 AM
Authorized User
 
Join Date: May 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ashfaque
Default

Create 2 unbount text boxes on your third form and enter the follwoing lines in each

=Forms!Mainform![Last Name] ------- type in first uboubd box
=Forms!Mainform!Subform1.Form![Last Name] -----type in second unbound text box

Then create another unound text box and concatinate the above 2 textboxes.

This you may get thru the command button also

Ashfaque

 
Old May 4th, 2006, 03:29 AM
Authorized User
 
Join Date: Apr 2006
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thank you very much for the advice Ashfaque but maybe I didn't understand!
Could you please tell me where exactly to write it each one!
Furthermore I'd like to inform you that I don't want text box but list box to select the last name (the last names, I think, I must take them as a query for each unbound box from its table/form.

 
Old May 6th, 2006, 12:02 AM
Authorized User
 
Join Date: May 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ashfaque
Default

The 2 unobound text boxes you should place on to your third form. And click into one of the them & write in it =Forms........ and simillarly for the second unbound text box also.

OR

Create a command button onto your third form and write following code on its OnClick event (Of Commmand Button). Now assume that your 2 new text box names are Text0 & Text1 and command button name is Command0. So code will be :

Private Sub Command0_OnClick()

Text0=Forms!Mainform![Last Name]
Text1==Forms!Mainform!Subform1.Form![Last Name]

End Sub

Once you click the command button, the data will be in to your 2 unbound text boxes. At last place another (Third) unbound text box and concatinate data of Text0 & Text1 into third unboud text box.

Like this:

=Text0 & " " & Text1

Please note that your Main form alongwith sub form must be open to get the data onto the third form.

Even if doesn't work, just drop me your 3 forms in a zip file along with your clear requirement. I will look into.

HTH
Ashfaque
 
Old May 9th, 2006, 08:51 AM
Authorized User
 
Join Date: Apr 2006
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

give me your e-mail

 
Old May 13th, 2006, 04:21 AM
Authorized User
 
Join Date: May 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ashfaque
Default

[email protected]






Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Form, run query, open form Grafixx01 Access 7 April 26th, 2007 11:32 AM
Printing a form with a subform in it jcalfg Access 1 July 25th, 2006 03:40 PM
Cant print when the form become subform yikchin Access 6 November 22nd, 2005 10:22 PM
form/subform reference tmc Access 1 August 7th, 2004 04:16 AM
form/subform problem chacquard Access VBA 5 June 21st, 2004 10:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.