displaying records on subform

  • Thread starter new2access via AccessMonster.com
  • Start date
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..
 
N

new2access via AccessMonster.com

addtional details:

by the way, i am using an unbound form as my mainform and inside it i have a
combo box and a subform where the records will show up.


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..
 
N

new2access via AccessMonster.com

can you please have a look to my database and see what's wrong?

Here's the link: http://www.zshare.net/download/6380693372b24bc7/



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..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top