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  

Linking



 
 
Thread Tools Display Modes
  #1  
Old January 9th, 2007, 03:34 AM posted to microsoft.public.access.forms
Ivor Williams
external usenet poster
 
Posts: 37
Default Linking

I have a form frmProjects. This form gets its data from table tblProjects
which has a primary key ProjNo. On the form is an unbound combobox called
cboProject which is used to select a project on the form.
On the form there is a tab control with a number of tabs, each of which has
on it a subform linked to frmProjects using ProjNo. On one of the tabs is a
subform sfrWarranty.
On sfrWarranty is a combobox cboUnit which is used to choose a unit. In the
row source for cboUnit, I went into the SQL statement and in Criteria under
ProjNo, entered "Forms!sfrWarranty.cboProjNo" (without the quotes) to limit
the units to choose from to those which pertain to the current project.
All works well until I choose a different project using cboProject on the
main form frmProjects. When I do this, the only way I can get the list in
cboUnit on the subform is to go to RecordsRefresh. So far, I've not been
able to determine the Event to apply to which control to make this happen
automatically.

Ivor


  #2  
Old January 9th, 2007, 04:31 AM posted to microsoft.public.access.forms
John Vinson
external usenet poster
 
Posts: 4,033
Default Linking

On Tue, 09 Jan 2007 03:34:53 GMT, "Ivor Williams"
wrote:

I went into the SQL statement and in Criteria under
ProjNo, entered "Forms!sfrWarranty.cboProjNo" (without the quotes) to limit
the units to choose from to those which pertain to the current project.
All works well until I choose a different project using cboProject on the
main form frmProjects. When I do this, the only way I can get the list in
cboUnit on the subform is to go to RecordsRefresh. So far, I've not been
able to determine the Event to apply to which control to make this happen
automatically.


Requery the combo box in the AfterUpdate event of cboProjNo:

Private Sub cboProjNo_AfterUpdate()
Me.cboUnit.Requery
End Sub

John W. Vinson[MVP]
 




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


All times are GMT +1. The time now is 06:11 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.