Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Linking two Forms

Discussion in 'Information Technology' started by Secret Squirrel, Nov 4, 2005.

Tags:
  1. Secret Squirrel

    Secret Squirrel
    Expand Collapse
    Guest

    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?
     
  2. Loading...


  3. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    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?
     
  4. Secret Squirrel

    Secret Squirrel
    Expand Collapse
    Guest

    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?

    >
    >
    >
     
  5. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    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
    >>> 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?
     
  6. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    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
    >>> 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?
     
  7. Secret Squirrel

    Secret Squirrel
    Expand Collapse
    Guest

    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
    > >>> 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?

    >
    >
    >
     
  8. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    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
    >>>> 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?
     
  9. Secret Squirrel

    Secret Squirrel
    Expand Collapse
    Guest

    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
    > >>>> 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?

    >
    >
    >
     
  10. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    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
    > 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
     
  11. Secret Squirrel

    Secret Squirrel
    Expand Collapse
    Guest

    The "Data Entry" is already set to No. What else could it be?

    "Joan Wild" wrote:

    >
    > 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
    > > 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
    >
    >
    >
     
  12. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    Open the recordsource for the second form. Can you see the entered data
    there?

    --
    Joan Wild
    Microsoft Access MVP

    Secret Squirrel wrote:
    > The "Data Entry" is already set to No. What else could it be?
    >
    > "Joan Wild" wrote:
    >
    >>
    >> 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 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
     
  13. Secret Squirrel

    Secret Squirrel
    Expand Collapse
    Guest

    Yes the record is in the table.

    "Joan Wild" wrote:

    > Open the recordsource for the second form. Can you see the entered data
    > there?
    >
    > --
    > Joan Wild
    > Microsoft Access MVP
    >
    > Secret Squirrel wrote:
    > > The "Data Entry" is already set to No. What else could it be?
    > >
    > > "Joan Wild" wrote:
    > >
    > >>
    > >> 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 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

    >
    >
    >
     
  14. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    OK, so we know the record is getting added. There must be something in the
    code behind the second form that is not showing existing records. Can you
    check the open/load/activate events to see?

    --
    Joan Wild
    Microsoft Access MVP

    Secret Squirrel wrote:
    > Yes the record is in the table.
    >
    > "Joan Wild" wrote:
    >
    >> Open the recordsource for the second form. Can you see the entered
    >> data there?
    >>
    >> --
    >> Joan Wild
    >> Microsoft Access MVP
    >>
    >> Secret Squirrel wrote:
    >>> The "Data Entry" is already set to No. What else could it be?
    >>>
    >>> "Joan Wild" wrote:
    >>>
    >>>>
    >>>> 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 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
     
  15. Secret Squirrel

    Secret Squirrel
    Expand Collapse
    Guest

    All the events on the second form are empty.

    "Joan Wild" wrote:

    > OK, so we know the record is getting added. There must be something in the
    > code behind the second form that is not showing existing records. Can you
    > check the open/load/activate events to see?
    >
    > --
    > Joan Wild
    > Microsoft Access MVP
    >
    > Secret Squirrel wrote:
    > > Yes the record is in the table.
    > >
    > > "Joan Wild" wrote:
    > >
    > >> Open the recordsource for the second form. Can you see the entered
    > >> data there?
    > >>
    > >> --
    > >> Joan Wild
    > >> Microsoft Access MVP
    > >>
    > >> Secret Squirrel wrote:
    > >>> The "Data Entry" is already set to No. What else could it be?
    > >>>
    > >>> "Joan Wild" wrote:
    > >>>
    > >>>>
    > >>>> 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 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

    >
    >
    >
     
  16. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    Let's see if I have this straight. You enter information in form 2. You
    close it. You open the recordsource for form 2 and you see the just-entered
    record. You open form 2, but don't see this information. Is that right?

    --
    Joan Wild
    Microsoft Access MVP

    Secret Squirrel wrote:
    > All the events on the second form are empty.
    >
    > "Joan Wild" wrote:
    >
    >> OK, so we know the record is getting added. There must be something
    >> in the code behind the second form that is not showing existing
    >> records. Can you check the open/load/activate events to see?
    >>
    >> --
    >> Joan Wild
    >> Microsoft Access MVP
    >>
    >> Secret Squirrel wrote:
    >>> Yes the record is in the table.
    >>>
    >>> "Joan Wild" wrote:
    >>>
    >>>> Open the recordsource for the second form. Can you see the entered
    >>>> data there?
    >>>>
    >>>> --
    >>>> Joan Wild
    >>>> Microsoft Access MVP
    >>>>
    >>>> Secret Squirrel wrote:
    >>>>> The "Data Entry" is already set to No. What else could it be?
    >>>>>
    >>>>> "Joan Wild" wrote:
    >>>>>
    >>>>>>
    >>>>>> 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 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
     
  17. Secret Squirrel

    Secret Squirrel
    Expand Collapse
    Guest

    Yes that is correct.

    "Joan Wild" wrote:

    > Let's see if I have this straight. You enter information in form 2. You
    > close it. You open the recordsource for form 2 and you see the just-entered
    > record. You open form 2, but don't see this information. Is that right?
    >
    > --
    > Joan Wild
    > Microsoft Access MVP
    >
    > Secret Squirrel wrote:
    > > All the events on the second form are empty.
    > >
    > > "Joan Wild" wrote:
    > >
    > >> OK, so we know the record is getting added. There must be something
    > >> in the code behind the second form that is not showing existing
    > >> records. Can you check the open/load/activate events to see?
    > >>
    > >> --
    > >> Joan Wild
    > >> Microsoft Access MVP
    > >>
    > >> Secret Squirrel wrote:
    > >>> Yes the record is in the table.
    > >>>
    > >>> "Joan Wild" wrote:
    > >>>
    > >>>> Open the recordsource for the second form. Can you see the entered
    > >>>> data there?
    > >>>>
    > >>>> --
    > >>>> Joan Wild
    > >>>> Microsoft Access MVP
    > >>>>
    > >>>> Secret Squirrel wrote:
    > >>>>> The "Data Entry" is already set to No. What else could it be?
    > >>>>>
    > >>>>> "Joan Wild" wrote:
    > >>>>>
    > >>>>>>
    > >>>>>> 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 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

    >
    >
    >
     
  18. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    How about you zip up the mdb and email it to me. Remove nospam from the
    address.

    --
    Joan Wild
    Microsoft Access MVP

    Secret Squirrel wrote:
    > Yes that is correct.
    >
    > "Joan Wild" wrote:
    >
    >> Let's see if I have this straight. You enter information in form 2.
    >> You close it. You open the recordsource for form 2 and you see the
    >> just-entered record. You open form 2, but don't see this
    >> information. Is that right?
    >>
    >> --
    >> Joan Wild
    >> Microsoft Access MVP
    >>
    >> Secret Squirrel wrote:
    >>> All the events on the second form are empty.
    >>>
    >>> "Joan Wild" wrote:
    >>>
    >>>> OK, so we know the record is getting added. There must be
    >>>> something in the code behind the second form that is not showing
    >>>> existing records. Can you check the open/load/activate events to
    >>>> see?
    >>>>
    >>>> --
    >>>> Joan Wild
    >>>> Microsoft Access MVP
    >>>>
    >>>> Secret Squirrel wrote:
    >>>>> Yes the record is in the table.
    >>>>>
    >>>>> "Joan Wild" wrote:
    >>>>>
    >>>>>> Open the recordsource for the second form. Can you see the
    >>>>>> entered data there?
    >>>>>>
    >>>>>> --
    >>>>>> Joan Wild
    >>>>>> Microsoft Access MVP
    >>>>>>
    >>>>>> Secret Squirrel wrote:
    >>>>>>> The "Data Entry" is already set to No. What else could it be?
    >>>>>>>
    >>>>>>> "Joan Wild" wrote:
    >>>>>>>
    >>>>>>>>
    >>>>>>>> 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 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
     
  19. Joan Wild

    Joan Wild
    Expand Collapse
    Guest

    Problem solved. If anyone's still reading, there was a saved filter on the
    second form. In addition there was an error of mine in an earlier post, and
    also data type problems and control sources wrong. I also suggested using
    the OpenArgs property to set the default value of the foreign key field in
    the second form.

    --
    Joan Wild
    Microsoft Access MVP

    Joan Wild wrote:
    > How about you zip up the mdb and email it to me. Remove nospam from
    > the address.
    >
    > --
    > Joan Wild
    > Microsoft Access MVP
    >
    > Secret Squirrel wrote:
    >> Yes that is correct.
    >>
    >> "Joan Wild" wrote:
    >>
    >>> Let's see if I have this straight. You enter information in form 2.
    >>> You close it. You open the recordsource for form 2 and you see the
    >>> just-entered record. You open form 2, but don't see this
    >>> information. Is that right?
    >>>
    >>> --
    >>> Joan Wild
    >>> Microsoft Access MVP
    >>>
    >>> Secret Squirrel wrote:
    >>>> All the events on the second form are empty.
    >>>>
    >>>> "Joan Wild" wrote:
    >>>>
    >>>>> OK, so we know the record is getting added. There must be
    >>>>> something in the code behind the second form that is not showing
    >>>>> existing records. Can you check the open/load/activate events to
    >>>>> see?
    >>>>>
    >>>>> --
    >>>>> Joan Wild
    >>>>> Microsoft Access MVP
    >>>>>
    >>>>> Secret Squirrel wrote:
    >>>>>> Yes the record is in the table.
    >>>>>>
    >>>>>> "Joan Wild" wrote:
    >>>>>>
    >>>>>>> Open the recordsource for the second form. Can you see the
    >>>>>>> entered data there?
    >>>>>>>
    >>>>>>> --
    >>>>>>> Joan Wild
    >>>>>>> Microsoft Access MVP
    >>>>>>>
    >>>>>>> Secret Squirrel wrote:
    >>>>>>>> The "Data Entry" is already set to No. What else could it be?
    >>>>>>>>
    >>>>>>>> "Joan Wild" wrote:
    >>>>>>>>
    >>>>>>>>>
    >>>>>>>>> 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 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
     

Share This Page