getting duplicates with subforms and different tables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sparks

    getting duplicates with subforms and different tables

    I was using this to swap out a form with subforms on it by just making
    a copy and tying each to copy of the same table.

    subformV1 tblVisit1
    subformV2 tblVisit2
    etc

    Select Case TabCtl0.Value
    Case 0: 'Initial Visit
    Child6.SourceOb ject = "subformV1"
    Child6.Visible = True
    Child6.Locked = False
    Child6.Form.Fil terOn = True
    Case 1: '6 Month
    Child6.SourceOb ject = "subformV2"
    Child6.Visible = True
    Child6.Locked = False
    Child6.Form.Fil terOn = True
    Case 2: '12 Month
    Child6.SourceOb ject = "subformV3"
    Child6.Visible = True
    Child6.Locked = False
    Child6.Form.Fil terOn = True
    Case Else
    Child6.Locked = False
    End Select

    well this worked fine each subform has multible subforms but
    everything on subformVx is all tied to one table.

    The main form just has Id and name and its tblmain and tied to the
    subforms 1 to 1 with an autoid

    then we had to enter some new dates.

    Main form

    subform date=====tblVis it1
    tabs with subforms
    TblVisit1

    EVERYTING works fine on visit 1
    BUT when you go to visit 2 enter a date and enter some data on the
    subforms and try to exit I get the old "duplicate values in index"

    I am thinking (I know thats scary) that the child6 blank form that I
    am using has link child to master of tblmain autoid === tblvisit1
    autoid
    when subformV2 is replaced it is still linked to tblvisit1 and not
    tblvisit2

    Can this be the problem?
    How can I set the linked tables correctly in this?


Working...