A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Requery method for combobox on subform



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2005, 10:31 PM
dgreen
external usenet poster
 
Posts: n/a
Default Requery method for combobox on subform

I'm having trouble getting a requery to work on combo boxes on a subform.
I have a main form that queries project ID from tables. The subform queries
from those fields additional information for a particular project id. It
works fine (yeah!). I want to have the combo boxes on the subform update
when entering new additional information for a project id. I have placed
combo boxes on two fields in the subform as a test. The combo boxes are not
updating with each project id selected. Any help is GREATLY appreciated!
(Combo boxes will be going on the majority of the fields on the subform once
I get my test case working.)

Here is what I have.

-----------
Main Form:
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;

---------

SubForm:

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.Re query
On Click: Forms("QueryProjectPhaseStage").cboDELIVERY_TYPE.R equery


Then tried this second:
subform combo boxes
On Click:
[Event Procedure]
Private Sub cboDELIVERY_TYPE_Click()
Me.QueryProjectPhaseStage.Form!cboDELIVERY_TYPE.Re query
'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


THANKS AGAIN!!!!!!
  #2  
Old June 30th, 2005, 11:25 PM
RuralGuy
external usenet poster
 
Posts: n/a
Default

Hi,

Are you familiar with this resource?

http://www.mvps.org/access/forms/frm0031.htm
Forms: Refer to Form and Subform properties and controls

Great post by the way! You put a lot of work into it!

HTH

--
RuralGuy

Please reply to the newsgroup so all may benefit.
  #3  
Old July 1st, 2005, 06:02 PM
dgreen
external usenet poster
 
Posts: n/a
Default

Thank you very much for directing me to this web site. I was not familiar
with it. Please forgive me, I'm a little new to Access, where/how do I
determine the "CONTROL" in the statement at that web site: "Subform1 is the
name of the subform CONTROL on mainform"?

"RuralGuy" wrote:

Hi,

Are you familiar with this resource?

http://www.mvps.org/access/forms/frm0031.htm
Forms: Refer to Form and Subform properties and controls

Great post by the way! You put a lot of work into it!

HTH

--
RuralGuy

Please reply to the newsgroup so all may benefit.

  #4  
Old July 1st, 2005, 07:14 PM
RuralGuy
external usenet poster
 
Posts: n/a
Default

wrote:

Thank you very much for directing me to this web site. I was not
familiar with it. Please forgive me, I'm a little new to Access,
where/how do I determine the "CONTROL" in the statement at that web
site: "Subform1 is the name of the subform CONTROL on mainform"?


Hi,

SubForms are displayed on forms by putting them in SubFormControls.
SubFormControls are for displaying Forms on other Forms. Most of the time
the developer doesn't change the name and I think the default name is the
same of the SubForm, but it doesn't have to be! At any rate the
SubFormControl has it's own name and the the form displayed within it (the
SubForm) has another name, that can be the same if you so choose.

Hope that helps.

--
RuralGuy

Please reply to the newsgroup so all may benefit.
 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Requery a subform from another subform Debbie Using Forms 4 May 4th, 2005 03:14 AM
requery tabs subform data if other tabs subform changes Chris General Discussion 1 April 20th, 2005 08:34 AM
Subform Refresh Problem (but only with an unbound combo box control) Barry Skidmore Using Forms 1 December 21st, 2004 01:19 AM
Requery Method Nexus Running & Setting Up Queries 1 June 25th, 2004 12:14 PM
Requery combo box on subform Doug Using Forms 2 June 6th, 2004 08:30 PM


All times are GMT +1. The time now is 01:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.