D
dgreen
I have a subform1 that queries project IDs and supporting data from
various tables. There are 6 text boxes on a main form, 3 of which
are used for a subform2 query. The subform2 query uses the 3 fields
on subform1 to obtain additional information for a particular project id.
The fields on the subform2 are currently text boxes displaying the
results from the subform2 query. They now need to be converted to
combo boxes that display choices based on what is in the 3 text boxes
of subform1.
This is where my problem lies. Do I put the requery on
subform1 after update or on each of the textboxes on subform1 for each
of the new comboboxes going on subform2?
How do I do this?
Any help is GREATLY appreciated!
Here is what I have.
-----------
SubForm1:
QueryProjectPhaseStage
Fields: PROJID
PROJECT_DESCR
PHASE
PHASE_DESCR
STAGE_OF_PROCESS
STAGE_DESCR
Record Source: Stage of Process Lookup - query
Stage of Process Lookup query table relationship
CAET_ML_PROJECT_CD --- CAET_STAGE_OF_PROCESS_CD --- CAET_PHASE_CD
Stage of Process Lookup query:
SELECT CAET_STAGE_OF_PROCESS_CD.*, CAET_PHASE_CD.*, CAET_ML_PROJECT_CD.*
FROM CAET_ML_PROJECT_CD INNER JOIN (
CAET_PHASE_CD INNER JOIN CAET_STAGE_OF_PROCESS_CD ON
CAET_PHASE_CD.PHASE_CODE = CAET_STAGE_OF_PROCESS_CD.Phase) ON
CAET_ML_PROJECT_CD.PROJECT_CODE =
CAET_STAGE_OF_PROCESS_CD.Projid
ORDER BY CAET_STAGE_OF_PROCESS_CD.Projid;
---------
SubForm2:
QueryLettersForm
Link Child Fields: PROJID;PHASE;STAGE_OF_PROCESS
Link Master Fields: Projid;Phase;Stage_of_process
Record Source: QueryLettersNew - query
QueryLettersNew query table
CAET_LTR
QueryLettersNew query:
SELECT CAET_LTR.* FROM CAET_LTR
WHERE
(((CAET_LTR.PROJID)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Projid])
AND
((CAET_LTR.PHASE)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Phase])
AND
((CAET_LTR.STAGE_OF_PROCESS)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Stage_of_process]))
ORDER BY CAET_LTR.LTR_NO;
ComboBoxes on SubForm:
ComboBox: cboResponseType
Control Source: RESPONSE_TYPE
Row Source Type: Table/Query
Row Source: SELECT CAET_RESPONSE_TYPE_CD.RESPONSE_TYPE FROM
CAET_RESPONSE_TYPE_CD WHERE
(((CAET_RESPONSE_TYPE_CD.PROJID)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Projid])
AND
((CAET_RESPONSE_TYPE_CD.PHASE)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Phase]));
ComboBox: cboDELIVERY_TYPE
Control Source: DELIVERY_TYPE
Row Source Type: Table/Query
Row Source: SELECT CAET_DELIVERY_TYPE_CD.DELIVERY_TYPE FROM
CAET_DELIVERY_TYPE_CD WHERE
(((CAET_DELIVERY_TYPE_CD.PROJID)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Projid])
AND
((CAET_DELIVERY_TYPE_CD.PHASE)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Phase]));
---------
Tried this first:
subform combo boxes
On Click: Forms("QueryProjectPhaseStage").cboResponseType.Requery
On Click: Forms("QueryProjectPhaseStage").cboDELIVERY_TYPE.Requery
Then tried this second:
subform combo boxes
On Click:
[Event Procedure]
Private Sub cboDELIVERY_TYPE_Click()
Me.QueryProjectPhaseStage.Form!cboDELIVERY_TYPE.Requery
'Me.QueryLettersForm.Form!cboDELIVERY_TYPE.Requery
'Forms("QueryProjectPhaseStage").cboDELIVERY_TYPE.Requery
'[Forms]![QueryProjectPhaseStage].[cboDELIVERY_TYPE].[Requery]
'Me.cboDELIVERY_TYPE.Requery
End Sub
Tried this third:
Stage of Process Lookup query on main form
After Update:
[Event Procedure]
Private Sub Form_AfterUpdate()
Me.QueryLettersForm.Form!cboResponseType.Requery
Me.QueryLettersForm.Form!cboDELIVERY_TYPE.Requery
End Sub
Tried this fourth:
Private Sub Form_AfterUpdate()
Me!QueryLettersForm.cboResponseType.Requery
Me!QueryLettersForm.cboDELIVERY_TYPE.Requery
End Sub
Private Sub Form_AfterUpdate()
Me!QueryLettersForm.Form!cboResponseType.Requery
Me!QueryLettersForm.Form!cboDELIVERY_TYPE.Requery
End Sub
Private Sub Form_AfterUpdate()
Me!QueryLettersForm.Form.cboResponseType.Requery
Me!QueryLettersForm.Form.cboDELIVERY_TYPE.Requery
End Sub
THANKS AGAIN!!!!!!
various tables. There are 6 text boxes on a main form, 3 of which
are used for a subform2 query. The subform2 query uses the 3 fields
on subform1 to obtain additional information for a particular project id.
The fields on the subform2 are currently text boxes displaying the
results from the subform2 query. They now need to be converted to
combo boxes that display choices based on what is in the 3 text boxes
of subform1.
This is where my problem lies. Do I put the requery on
subform1 after update or on each of the textboxes on subform1 for each
of the new comboboxes going on subform2?
How do I do this?
Any help is GREATLY appreciated!
Here is what I have.
-----------
SubForm1:
QueryProjectPhaseStage
Fields: PROJID
PROJECT_DESCR
PHASE
PHASE_DESCR
STAGE_OF_PROCESS
STAGE_DESCR
Record Source: Stage of Process Lookup - query
Stage of Process Lookup query table relationship
CAET_ML_PROJECT_CD --- CAET_STAGE_OF_PROCESS_CD --- CAET_PHASE_CD
Stage of Process Lookup query:
SELECT CAET_STAGE_OF_PROCESS_CD.*, CAET_PHASE_CD.*, CAET_ML_PROJECT_CD.*
FROM CAET_ML_PROJECT_CD INNER JOIN (
CAET_PHASE_CD INNER JOIN CAET_STAGE_OF_PROCESS_CD ON
CAET_PHASE_CD.PHASE_CODE = CAET_STAGE_OF_PROCESS_CD.Phase) ON
CAET_ML_PROJECT_CD.PROJECT_CODE =
CAET_STAGE_OF_PROCESS_CD.Projid
ORDER BY CAET_STAGE_OF_PROCESS_CD.Projid;
---------
SubForm2:
QueryLettersForm
Link Child Fields: PROJID;PHASE;STAGE_OF_PROCESS
Link Master Fields: Projid;Phase;Stage_of_process
Record Source: QueryLettersNew - query
QueryLettersNew query table
CAET_LTR
QueryLettersNew query:
SELECT CAET_LTR.* FROM CAET_LTR
WHERE
(((CAET_LTR.PROJID)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Projid])
AND
((CAET_LTR.PHASE)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Phase])
AND
((CAET_LTR.STAGE_OF_PROCESS)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Stage_of_process]))
ORDER BY CAET_LTR.LTR_NO;
ComboBoxes on SubForm:
ComboBox: cboResponseType
Control Source: RESPONSE_TYPE
Row Source Type: Table/Query
Row Source: SELECT CAET_RESPONSE_TYPE_CD.RESPONSE_TYPE FROM
CAET_RESPONSE_TYPE_CD WHERE
(((CAET_RESPONSE_TYPE_CD.PROJID)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Projid])
AND
((CAET_RESPONSE_TYPE_CD.PHASE)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Phase]));
ComboBox: cboDELIVERY_TYPE
Control Source: DELIVERY_TYPE
Row Source Type: Table/Query
Row Source: SELECT CAET_DELIVERY_TYPE_CD.DELIVERY_TYPE FROM
CAET_DELIVERY_TYPE_CD WHERE
(((CAET_DELIVERY_TYPE_CD.PROJID)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Projid])
AND
((CAET_DELIVERY_TYPE_CD.PHASE)=[Forms]![LetterInputTest2]![QueryProjectPhaseStage].[Form]![Phase]));
---------
Tried this first:
subform combo boxes
On Click: Forms("QueryProjectPhaseStage").cboResponseType.Requery
On Click: Forms("QueryProjectPhaseStage").cboDELIVERY_TYPE.Requery
Then tried this second:
subform combo boxes
On Click:
[Event Procedure]
Private Sub cboDELIVERY_TYPE_Click()
Me.QueryProjectPhaseStage.Form!cboDELIVERY_TYPE.Requery
'Me.QueryLettersForm.Form!cboDELIVERY_TYPE.Requery
'Forms("QueryProjectPhaseStage").cboDELIVERY_TYPE.Requery
'[Forms]![QueryProjectPhaseStage].[cboDELIVERY_TYPE].[Requery]
'Me.cboDELIVERY_TYPE.Requery
End Sub
Tried this third:
Stage of Process Lookup query on main form
After Update:
[Event Procedure]
Private Sub Form_AfterUpdate()
Me.QueryLettersForm.Form!cboResponseType.Requery
Me.QueryLettersForm.Form!cboDELIVERY_TYPE.Requery
End Sub
Tried this fourth:
Private Sub Form_AfterUpdate()
Me!QueryLettersForm.cboResponseType.Requery
Me!QueryLettersForm.cboDELIVERY_TYPE.Requery
End Sub
Private Sub Form_AfterUpdate()
Me!QueryLettersForm.Form!cboResponseType.Requery
Me!QueryLettersForm.Form!cboDELIVERY_TYPE.Requery
End Sub
Private Sub Form_AfterUpdate()
Me!QueryLettersForm.Form.cboResponseType.Requery
Me!QueryLettersForm.Form.cboDELIVERY_TYPE.Requery
End Sub
THANKS AGAIN!!!!!!