1c7c0 Linking two Forms
Sign Up |  Live StatsLive Stats    Articles 37,350| Comments 177,414| Members 19,424, Newest yashpal singh| Online 414
Home Contact
 (Forgotten?): 
    Ishmeet Singh - First Voice of India 2008 Winner
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags

Linking two Forms

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 115 USD (23%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Data Linking between Forms Tdahlman Information Technology 1 28-Jul-2006 08:42 AM
Linking Tables Jennifer Cali Information Technology 1 28-Jul-2006 08:34 AM
Linking A Text Box Dave Information Technology 7 28-Jul-2006 08:34 AM
Linking with Table Denise Information Technology 1 28-Jul-2006 08:33 AM
linking 2 sub forms Bob Richardson Information Technology 0 10-Nov-2005 21:09 PM


Tags
linking, two, forms
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 04-Nov-2005, 15:20 PM
Secret Squirrel's Avatar Secret Squirrel
Guest
 
Posts: n/a
   
   
Linking two Forms

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I have a form where users will do all their data entry. I have another form
where they can add additional information for that particular record. The can
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/6661-linking-two-forms.html
click on a command button to access this other form. But when they click on
this button I want to be able to carry over the Primary key field (the
autonumberID) and have it populate a field on this other form. This way I can
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
tie the two tables together. But here's the catch, I want people to also
access this other form via the switchboard as well without carrying over the
Primary Key from that main form. There are two way to create a record on this
form. One is directly and the other is through the main data entry form.
There are two ways a record can be generated. Am I making sense here?


Got anything to share on This Topic? Why not share your immediate thoughts/reaction with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-Nov-2005, 15:20 PM
Joan Wild's Avatar Joan Wild
Guest
 
Posts: n/a
   
   
Re: Linking two Forms

From form one...
DoCmd.OpenForm "SecondForm", , , "[SomeID] = Forms![FormOne]![SomeID]"
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661


--
Joan Wild
Microsoft Access MVP

Secret Squirrel wrote:
> I have a form where users will do all their data entry. I have
> another form where they can add additional information for that
> particular record. The can click on a command button to access this
> other form. But when they click on this button I want to be able to
> carry over the Primary key field (the autonumberID) and have it
> populate a field on this other form. This way I can tie the two
> tables together. But here's the catch, I want people to also access
> this other form via the switchboard as well without carrying over the
> Primary Key from that main form. There are two way to create a record
> on this form. One is directly and the other is through the main data
> entry form. There are two ways a record can be generated. Am I making
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> sense here?



Reply With Quote
  #3 (permalink)  
Old 04-Nov-2005, 15:20 PM
Secret Squirrel's Avatar Secret Squirrel
Guest
 
Posts: n/a
   
   
Re: Linking two Forms

But will that second form always open to that specific record if it's tied
into the first record?

"Joan Wild" wrote:

> From form one...
> DoCmd.OpenForm "SecondForm", , , "[SomeID] = Forms![FormOne]![SomeID]"
>
>
> --
> Joan Wild
> Microsoft Access MVP
>
> Secret Squirrel wrote:
> > I have a form where users will do all their data entry. I have
> > another form where they can add additional information for that
> > particular record. The can click on a command button to access this
> > other form. But when they click on this button I want to be able to
> > carry over the Primary key field (the autonumberID) and have it
> > populate a field on this other form. This way I can tie the two
> > tables together. But here's the catch, I want people to also access
> > this other form via the switchboard as well without carrying over the
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> > Primary Key from that main form. There are two way to create a record
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> > on this form. One is directly and the other is through the main data
> > entry form. There are two ways a record can be generated. Am I making
> > sense here?

>
>
>

Reply With Quote
  #4 (permalink)  
Old 05-Nov-2005, 12:48 PM
Joan Wild's Avatar Joan Wild
Guest
 
Posts: n/a
   
   
Re: Linking two Forms

Yes

--
Joan Wild
Microsoft Access MVP

Secret Squirrel wrote:
> But will that second form always open to that specific record if it's
> tied into the first record?
>
> "Joan Wild" wrote:
>
>> From form one...
>> DoCmd.OpenForm "SecondForm", , , "[SomeID] =
>> Forms![FormOne]![SomeID]"
>>
>>
>> --
>> Joan Wild
>> Microsoft Access MVP
>>
>> Secret Squirrel wrote:
>>> I have a form where users will do all their data entry. I have
>>> another form where they can add additional information for that
>>> particular record. The can click on a command button to access this
>>> other form. But when they click on this button I want to be able to
>>> carry over the Primary key field (the autonumberID) and have it
>>> populate a field on this other form. This way I can tie the two
>>> tables together. But here's the catch, I want people to also access
>>> this other form via the switchboard as well without carrying over
>>> the Primary Key from that main form. There are two way to create a
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
>>> record on this form. One is directly and the other is through the
>>> main data entry form. There are two ways a record can be generated.
>>> Am I making sense here?



Reply With Quote
  #5 (permalink)  
Old 05-Nov-2005, 12:48 PM
Joan Wild's Avatar Joan Wild
Guest
 
Posts: n/a
   
   
Re: Linking two Forms

Sorry I was confused with another thread. You are putting that code in the
first form's module. So it will only apply when you open the second form
from the first.

It's not 'tied' to the first record. If you open your first form and go to
the 6th record (ID=559 for eg.), and you hit the button to open the second
form; the second form will open to show you related information for ID=559.

Perhaps I misunderstand your question.


--
Joan Wild
Microsoft Access MVP

Secret Squirrel wrote:
> But will that second form always open to that specific record if it's
> tied into the first record?
>
> "Joan Wild" wrote:
>
>> From form one...
>> DoCmd.OpenForm "SecondForm", , , "[SomeID] =
>> Forms![FormOne]![SomeID]"
>>
>>
>> --
>> Joan Wild
>> Microsoft Access MVP
>>
>> Secret Squirrel wrote:
>>> I have a form where users will do all their data entry. I have
>>> another form where they can add additional information for that
>>> particular record. The can click on a command button to access this
>>> other form. But when they click on this button I want to be able to
>>> carry over the Primary key field (the autonumberID) and have it
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
>>> populate a field on this other form. This way I can tie the two
>>> tables together. But here's the catch, I want people to also access
>>> this other form via the switchboard as well without carrying over
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
>>> the Primary Key from that main form. There are two way to create a
>>> record on this form. One is directly and the other is through the
>>> main data entry form. There are two ways a record can be generated.
>>> Am I making sense here?



Reply With Quote
  #6 (permalink)  
Old 05-Nov-2005, 12:48 PM
Secret Squirrel's Avatar Secret Squirrel
Guest
 
Posts: n/a
   
   
Re: Linking two Forms

Ok now I'm confused. ;-) I am putting this code in the first forms module?
Where exactly is that? The way you explained it below is exactly what I am
looking for.

"Joan Wild" wrote:

> Sorry I was confused with another thread. You are putting that code in the
> first form's module. So it will only apply when you open the second form
> from the first.
>
> It's not 'tied' to the first record. If you open your first form and go to
> the 6th record (ID=559 for eg.), and you hit the button to open the second
> form; the second form will open to show you related information for ID=559.
>
> Perhaps I misunderstand your question.
>
>
> --
> Joan Wild
> Microsoft Access MVP
>
> Secret Squirrel wrote:
> > But will that second form always open to that specific record if it's
> > tied into the first record?
> >
> > "Joan Wild" wrote:
> >
> >> From form one...
> >> DoCmd.OpenForm "SecondForm", , , "[SomeID] =
> >> Forms![FormOne]![SomeID]"
> >>
> >>
> >> --
> >> Joan Wild
> >> Microsoft Access MVP
> >>
> >> Secret Squirrel wrote:
> >>> I have a form where users will do all their data entry. I have
> >>> another form where they can add additional information for that
> >>> particular record. The can click on a command button to access this
> >>> other form. But when they click on this button I want to be able to
> >>> carry over the Primary key field (the autonumberID) and have it
> >>> populate a field on this other form. This way I can tie the two
> >>> tables together. But here's the catch, I want people to also access
> >>> this other form via the switchboard as well without carrying over
> >>> the Primary Key from that main form. There are two way to create a
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> >>> record on this form. One is directly and the other is through the
> >>> main data entry form. There are two ways a record can be generated.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> >>> Am I making sense here?

>
>
>

Reply With Quote
  #7 (permalink)  
Old 05-Nov-2005, 12:48 PM
Joan Wild's Avatar Joan Wild
Guest
 
Posts: n/a
   
   
Re: Linking two Forms

OK, let's start from square one.

You wrote

"I have a form where users will do all their data entry. I have
another form where they can add additional information for that
particular record. The can click on a command button to access
this other form."

I'm referring to the code you have in the click event for this command
button. It should be something like
DoCmd.OpenForm "SecondForm", , , "[SomeID] = Forms![FormOne]![SomeID]"

You would substitute the name of your second form for SecondForm; the name
of the primary key field for SomeID.

How about you post what is currently in the click event for your command
button, and also the name of the primary key field in the one form and the
name of the foreign key in the second form.

--
Joan Wild
Microsoft Access MVP

Secret Squirrel wrote:
> Ok now I'm confused. ;-) I am putting this code in the first forms
> module? Where exactly is that? The way you explained it below is
> exactly what I am looking for.
>
> "Joan Wild" wrote:
>
>> Sorry I was confused with another thread. You are putting that code
>> in the first form's module. So it will only apply when you open the
>> second form from the first.
>>
>> It's not 'tied' to the first record. If you open your first form
>> and go to the 6th record (ID=559 for eg.), and you hit the button to
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
>> open the second form; the second form will open to show you related
>> information for ID=559.
>>
>> Perhaps I misunderstand your question.
>>
>>
>> --
>> Joan Wild
>> Microsoft Access MVP
>>
>> Secret Squirrel wrote:
>>> But will that second form always open to that specific record if
>>> it's tied into the first record?
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
>>>
>>> "Joan Wild" wrote:
>>>
>>>> From form one...
>>>> DoCmd.OpenForm "SecondForm", , , "[SomeID] =
>>>> Forms![FormOne]![SomeID]"
>>>>
>>>>
>>>> --
>>>> Joan Wild
>>>> Microsoft Access MVP
>>>>
>>>> Secret Squirrel wrote:
>>>>> I have a form where users will do all their data entry. I have
>>>>> another form where they can add additional information for that
>>>>> particular record. The can click on a command button to access
>>>>> this other form. But when they click on this button I want to be
>>>>> able to carry over the Primary key field (the autonumberID) and
>>>>> have it populate a field on this other form. This way I can tie
>>>>> the two tables together. But here's the catch, I want people to
>>>>> also access this other form via the switchboard as well without
>>>>> carrying over the Primary Key from that main form. There are two
>>>>> way to create a record on this form. One is directly and the
>>>>> other is through the main data entry form. There are two ways a
>>>>> record can be generated. Am I making sense here?



Reply With Quote
  #8 (permalink)  
Old 05-Nov-2005, 12:48 PM
Secret Squirrel's Avatar Secret Squirrel
Guest
 
Posts: n/a
   
   
Re: Linking two Forms

Ok here is the code from my command button. It is what you said it should be
but when I key information on the second page and then exit out and go back
into it the data is blank. Almost like it's starting a new record.

Private Sub Command209_Click()
On Error GoTo Err_Command209_Click

DoCmd.OpenForm "frmCorrectiveActionRMA", , , "[RMA#] = Forms![2005
Form]![RMA#]"

Exit_Command209_Click:
Exit Sub

Err_Command209_Click:
MsgBox Err.Description
Resume Exit_Command209_Click

End Sub

My primary key on my first form is RMA#. The foreign key on the second form
is also RMA#. I have the foreign key linked to the first form's RMA#. Is that
correct also?

"Joan Wild" wrote:

> OK, let's start from square one.
>
> You wrote
>
> "I have a form where users will do all their data entry. I have
> another form where they can add additional information for that
> particular record. The can click on a command button to access
> this other form."
>
> I'm referring to the code you have in the click event for this command
> button. It should be something like
> DoCmd.OpenForm "SecondForm", , , "[SomeID] = Forms![FormOne]![SomeID]"
>
> You would substitute the name of your second form for SecondForm; the name
> of the primary key field for SomeID.
>
> How about you post what is currently in the click event for your command
> button, and also the name of the primary key field in the one form and the
> name of the foreign key in the second form.
>
> --
> Joan Wild
> Microsoft Access MVP
>
> Secret Squirrel wrote:
> > Ok now I'm confused. ;-) I am putting this code in the first forms
> > module? Where exactly is that? The way you explained it below is
> > exactly what I am looking for.
> >
> > "Joan Wild" wrote:
> >
> >> Sorry I was confused with another thread. You are putting that code
> >> in the first form's module. So it will only apply when you open the
> >> second form from the first.
> >>
> >> It's not 'tied' to the first record. If you open your first form
> >> and go to the 6th record (ID=559 for eg.), and you hit the button to
> >> open the second form; the second form will open to show you related
> >> information for ID=559.
> >>
> >> Perhaps I misunderstand your question.
> >>
> >>
> >> --
> >> Joan Wild
> >> Microsoft Access MVP
> >>
> >> Secret Squirrel wrote:
> >>> But will that second form always open to that specific record if
> >>> it's tied into the first record?
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> >>>
> >>> "Joan Wild" wrote:
> >>>
> >>>> From form one...
> >>>> DoCmd.OpenForm "SecondForm", , , "[SomeID] =
> >>>> Forms![FormOne]![SomeID]"
> >>>>
> >>>>
> >>>> --
> >>>> Joan Wild
> >>>> Microsoft Access MVP
> >>>>
> >>>> Secret Squirrel wrote:
> >>>>> I have a form where users will do all their data entry. I have
> >>>>> another form where they can add additional information for that
> >>>>> particular record. The can click on a command button to access
> >>>>> this other form. But when they click on this button I want to be
> >>>>> able to carry over the Primary key field (the autonumberID) and
> >>>>> have it populate a field on this other form. This way I can tie
> >>>>> the two tables together. But here's the catch, I want people to
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> >>>>> also access this other form via the switchboard as well without
> >>>>> carrying over the Primary Key from that main form. There are two
> >>>>> way to create a record on this form. One is directly and the
> >>>>> other is through the main data entry form. There are two ways a
> >>>>> record can be generated. Am I making sense here?

>
>
>

Reply With Quote
  #9 (permalink)  
Old 05-Nov-2005, 12:48 PM
Joan Wild's Avatar Joan Wild
Guest
 
Posts: n/a
   
   
Re: Linking two Forms

  Donate Today!  

Secret Squirrel wrote:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> Ok here is the code from my command button. It is what you said it
> should be but when I key information on the second page and then exit
> out and go back into it the data is blank. Almost like it's starting
> a new record.


Check the properties for the second form. Perhaps you have it set to 'Data
Entry' - yes. That will always open the form to a new record, and show no
existing records.

--
Joan Wild
Microsoft Access MVP


Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Is Science a Religion?
By akiva
Today 04:37 AM
16 Replies, 2,042 Views
UNITED SIKHS AID Team...
Today 03:19 AM
0 Replies, 11 Views
Woolwich Killing: The...
Today 03:05 AM
26 Replies, 281 Views
Abu Nusaybah, 'Friend'...
Today 02:33 AM
0 Replies, 21 Views
Stockholm riots throw...
Today 02:14 AM
10 Replies, 97 Views
How does Sikhi help you...
Today 02:04 AM
48 Replies, 1,215 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 01:52 AM
186 Replies, 4,638 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 01:41 AM
322 Replies, 7,723 Views
Paneer: what I have...
Yesterday 22:29 PM
8 Replies, 75 Views
How Many Sikhs Have...
Yesterday 21:55 PM
698 Replies, 51,738 Views
Transgenderism ... Right...
By Kaylee
Yesterday 17:55 PM
31 Replies, 1,380 Views
Rochester Gurdwara...
Yesterday 10:55 AM
2 Replies, 85 Views
US Congress panel passes...
Yesterday 04:22 AM
0 Replies, 46 Views
Harmeet Kaur Took the...
Yesterday 03:40 AM
0 Replies, 69 Views
Panjabi Alphabet Resource
24-May-2013 23:15 PM
12 Replies, 6,564 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 04:38 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.69164 seconds with 32 queries
0