N
new2access via AccessMonster.com
how can i display records to a subform using a combo box as a selection.
What i am doing is a training database, with list of training schedules. I
have the following:
- a Combo Box [cmbMonth] based on [tblMonth] having 2 fields m_ID (PK)
m_Name (Text) 'for the month names'
cmbMonth row source:
SELECT [tblMonths].[NTS_Month], [tblMonths].[NTS_MonthName] FROM tblMonths;
cmbMonth row source type:
Table/Query
- a Subform [ScheduleSubform] based on a query [qrySchedule]
Subform source object: ScheduleSubform
qrySchedule SQL:
SELECT Schedule.ID, Schedule.TraineeID, Schedule.NTS_Month, Trainees.LastName,
Trainees.FirstName, Trainees.JobTitle, Trainees.SupervisorContactNo
FROM Trainees INNER JOIN Schedule ON Trainees.TraineeID = Schedule.TraineeID
WHERE (((Schedule.NTS_Month)>=DateSerial(Year(Date()),Month(Date()),1) And
(Schedule.NTS_Month)<DateSerial(Year(Date()),Month(Date())+1,1))) OR ((
(Schedule.NTS_Month) Is Null));
when i open the form, it display the current month's schedule and null
records (which is what i wanted).but if the user wants to check next month's
schedule (or any month) using the cmbMonth combo box, records doesn't show up.
Please i need guidance on this one cause im really lost..
What i am doing is a training database, with list of training schedules. I
have the following:
- a Combo Box [cmbMonth] based on [tblMonth] having 2 fields m_ID (PK)
m_Name (Text) 'for the month names'
cmbMonth row source:
SELECT [tblMonths].[NTS_Month], [tblMonths].[NTS_MonthName] FROM tblMonths;
cmbMonth row source type:
Table/Query
- a Subform [ScheduleSubform] based on a query [qrySchedule]
Subform source object: ScheduleSubform
qrySchedule SQL:
SELECT Schedule.ID, Schedule.TraineeID, Schedule.NTS_Month, Trainees.LastName,
Trainees.FirstName, Trainees.JobTitle, Trainees.SupervisorContactNo
FROM Trainees INNER JOIN Schedule ON Trainees.TraineeID = Schedule.TraineeID
WHERE (((Schedule.NTS_Month)>=DateSerial(Year(Date()),Month(Date()),1) And
(Schedule.NTS_Month)<DateSerial(Year(Date()),Month(Date())+1,1))) OR ((
(Schedule.NTS_Month) Is Null));
when i open the form, it display the current month's schedule and null
records (which is what i wanted).but if the user wants to check next month's
schedule (or any month) using the cmbMonth combo box, records doesn't show up.
Please i need guidance on this one cause im really lost..