1c7bf Linking two Forms
Sign Up |  Live StatsLive Stats    Articles 37,347| Comments 177,375| Members 19,423, Newest mohyal| Online 423
Home Contact
 (Forgotten?): 
    Sikhism
    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
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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
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]"


--
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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> particular record. The can click on a command button to access this
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> 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
  #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]"
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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> > 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
  #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] =
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
>> 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
  #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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
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
>>> 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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> 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
> >>
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> >> 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
  #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
>> open the second form; the second form will open to show you related
>> information for ID=559.
>>
>> Perhaps I misunderstand your question.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
>>
>>
>> --
>> 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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
>>>>> 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?
> >>>
> >>> "Joan Wild" wrote:
> >>>
> >>>> From form one...
> >>>> DoCmd.OpenForm "SecondForm", , , "[SomeID] =
> >>>> Forms![FormOne]![SomeID]"
> >>>>
> >>>>
> >>>> --
> >>>> Joan Wild
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> >>>> 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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> >>>>> 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
  #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:
> 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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
> 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
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=6661
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
Woolwich Killing: The...
Today 19:09 PM
17 Replies, 206 Views
How does Sikhi help you...
Today 18:52 PM
47 Replies, 1,188 Views
Paneer: what I have...
By Ishna
Today 17:57 PM
4 Replies, 48 Views
Transgenderism ... Right...
By Kaylee
Today 17:55 PM
31 Replies, 1,374 Views
Is Science a Religion?
Today 15:04 PM
12 Replies, 1,988 Views
Rochester Gurdwara...
Today 10:55 AM
2 Replies, 77 Views
US Congress panel passes...
Today 04:22 AM
0 Replies, 41 Views
Harmeet Kaur Took the...
Today 03:40 AM
0 Replies, 59 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 01:43 AM
319 Replies, 7,703 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 00:36 AM
182 Replies, 4,622 Views
Panjabi Alphabet Resource
Yesterday 23:15 PM
12 Replies, 6,559 Views
Biography of a Scholar:...
Yesterday 22:53 PM
1 Replies, 87 Views
Dusting The Web
Yesterday 22:25 PM
0 Replies, 46 Views
How Pure the Tongue? New...
Yesterday 21:29 PM
0 Replies, 63 Views
Stockholm riots throw...
Yesterday 21:14 PM
1 Replies, 47 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 19:59 PM.
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.68849 seconds with 32 queries
0