T
tbrogdon
I have two tbls:tblMyFirstTable (composite PK of 3 fields) and
tblMySecondTable (includes same composite key as fk and contains
details pertaining to the first table).
I have 2 forms: frmMyFirstForm (autoform of tblMyFirstTable with
subform deleted) and frmMySecondForm (autoform rendition of
tblMySecondTable) so they are not automatically linked.
frmMyFirstForm has 4 controls: a txtField and cboField1 and cboField2
(which together make up the composite PK) and cmdOpenForm.
frmMySecondForm has many fields including txtField, cboField1,
cboFIeld2. It also has cmdExit
I want the user to input data in frmMyFirstForm and click cmdOpenForm
which should open frmMySecondForm and populate fields of the same name
on frmMySecondForm but re-enter themselves for every entry the user
makes on formMySecondForm during this session until clicking cmdExit.
In other words if Field1, 2, and 3 are the PK in tblMyFirstTable, I
want those values automatically entered in tblMysecondTable from
frmMySecondForm after being input on frmMyFirstForm - and the user
will make MULTIPLE entries in frmMySecondForm all of which will need
those values from the 3 fields in frmMyFirstForm.
How do I do this? I've tried coding the cmdOpenForm:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMySecondForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria
And the On_Open event of frmMySecondForm to:
DoCmd.GoToRecord , , acNewRec
Me!txtDate = Forms!ProductOperation!txtDate
Me!cboDept = Forms!ProductOperation!cboDept
Me!cboShift = Forms!ProductOperation!cboShift
This obviously (now) doesn't work and has led me down innumerable dead-
ends and is obviously (now) not enough code and probably not the
correct logic.
I am sure I don't know what I am doing with this and I wish this
wasn't so confusing. I think what makes it confusing is the composite
key but I HAVE to use the composite.
Thanks in advance,
Tim
tblMySecondTable (includes same composite key as fk and contains
details pertaining to the first table).
I have 2 forms: frmMyFirstForm (autoform of tblMyFirstTable with
subform deleted) and frmMySecondForm (autoform rendition of
tblMySecondTable) so they are not automatically linked.
frmMyFirstForm has 4 controls: a txtField and cboField1 and cboField2
(which together make up the composite PK) and cmdOpenForm.
frmMySecondForm has many fields including txtField, cboField1,
cboFIeld2. It also has cmdExit
I want the user to input data in frmMyFirstForm and click cmdOpenForm
which should open frmMySecondForm and populate fields of the same name
on frmMySecondForm but re-enter themselves for every entry the user
makes on formMySecondForm during this session until clicking cmdExit.
In other words if Field1, 2, and 3 are the PK in tblMyFirstTable, I
want those values automatically entered in tblMysecondTable from
frmMySecondForm after being input on frmMyFirstForm - and the user
will make MULTIPLE entries in frmMySecondForm all of which will need
those values from the 3 fields in frmMyFirstForm.
How do I do this? I've tried coding the cmdOpenForm:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmMySecondForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria
And the On_Open event of frmMySecondForm to:
DoCmd.GoToRecord , , acNewRec
Me!txtDate = Forms!ProductOperation!txtDate
Me!cboDept = Forms!ProductOperation!cboDept
Me!cboShift = Forms!ProductOperation!cboShift
This obviously (now) doesn't work and has led me down innumerable dead-
ends and is obviously (now) not enough code and probably not the
correct logic.
I am sure I don't know what I am doing with this and I wish this
wasn't so confusing. I think what makes it confusing is the composite
key but I HAVE to use the composite.
Thanks in advance,
Tim