D
desireemm via AccessMonster.com
I created a table called the Family_Hours (look up table for a combo box)
this is based on the type of family and how many chidren they have and if
dad is at home then that determines how many hours they are responsible for
per week and month.
The table has three fields one is called TypeOfPariticpant, Month and Weekly
2 parent family = Weekly_hrs 40 Hours = Month 173 Hours
single parent child over 6 years = Weekly_hrs 30 hours = Month 130 Hours
sigle parent child under 6 years = Weekly_hrs 20 hours = Month 87 Hours
child under 1 year = Weekly_hrs 0 hours = Month 0 Hours
the users wants to choose what kind of family it is then have the hours
automatically pop up in the drop down. I hope that makes sense??
The part with the family is called TypeofParticipant the lower numbers are
WeeklyHours and the Higher numbers are Montly totals
and in the Event View under AfterUpdate here is the code I used
Combo1.RowSource = "SELECT FamilyHrID, TypeOfParticipant, WeeklyHours,
MonthlyHours FROM FamilyHours_tbl"
Combo1.ColumnCount = 4
Combo1.ColumnWidths = 0cm;2,503cm;0cm;0cm (sorry: in centimetres here!)
Combo1.BoundColumn = 1
Combo1.LimitToList = True
Combo2.RowSource = "SELECT FamilyHrID, WeeklyHours FROM FamilyHours_tbl"
Combo2.ColumnCount = 2
Combo2.ColumnWidths = 0cm;2,503cm
Combo2.BoundColumn = 2
Combo2.LimitToList = True
Combo3.RowSource = "SELECT FamilyHrID, MonthlyHours FROM FamilyHours_tbl"
Combo3.ColumnCount = 2
Combo3.ColumnWidths = 0cm;2,503cm
Combo3.BoundColumn = 2
Combo3.LimitToList = True
I need to hard code this into the afterupdate of the combo box instead of
using a lookup table and then coding it. and I was wondering how would I do
this. The Fields will never change, they will always remain the same there
wont be any change to TypeofParticipants, will always be the same thing. Can
someone show me how I can hard code this in and just use the Combo box
instead, please? Thank you
this is based on the type of family and how many chidren they have and if
dad is at home then that determines how many hours they are responsible for
per week and month.
The table has three fields one is called TypeOfPariticpant, Month and Weekly
2 parent family = Weekly_hrs 40 Hours = Month 173 Hours
single parent child over 6 years = Weekly_hrs 30 hours = Month 130 Hours
sigle parent child under 6 years = Weekly_hrs 20 hours = Month 87 Hours
child under 1 year = Weekly_hrs 0 hours = Month 0 Hours
the users wants to choose what kind of family it is then have the hours
automatically pop up in the drop down. I hope that makes sense??
The part with the family is called TypeofParticipant the lower numbers are
WeeklyHours and the Higher numbers are Montly totals
and in the Event View under AfterUpdate here is the code I used
Combo1.RowSource = "SELECT FamilyHrID, TypeOfParticipant, WeeklyHours,
MonthlyHours FROM FamilyHours_tbl"
Combo1.ColumnCount = 4
Combo1.ColumnWidths = 0cm;2,503cm;0cm;0cm (sorry: in centimetres here!)
Combo1.BoundColumn = 1
Combo1.LimitToList = True
Combo2.RowSource = "SELECT FamilyHrID, WeeklyHours FROM FamilyHours_tbl"
Combo2.ColumnCount = 2
Combo2.ColumnWidths = 0cm;2,503cm
Combo2.BoundColumn = 2
Combo2.LimitToList = True
Combo3.RowSource = "SELECT FamilyHrID, MonthlyHours FROM FamilyHours_tbl"
Combo3.ColumnCount = 2
Combo3.ColumnWidths = 0cm;2,503cm
Combo3.BoundColumn = 2
Combo3.LimitToList = True
Code:
Private Sub TypeOfParticipant_AfterUpdate()
Me.Weekly = Me.TypeOfParticipant.Column(2)
Me.Weekly.SetFocus
Me.Weekly.Dropdown
Me.Month = Me.TypeOfParticipant.Column(3)
Me.Month.SetFocus
Me.Month.Dropdown
Me.TypeOfParticipant.SetFocus
End Sub
I need to hard code this into the afterupdate of the combo box instead of
using a lookup table and then coding it. and I was wondering how would I do
this. The Fields will never change, they will always remain the same there
wont be any change to TypeofParticipants, will always be the same thing. Can
someone show me how I can hard code this in and just use the Combo box
instead, please? Thank you