S
Satadru Sengupta
Friends,
I have a problem on unbound forms.
On the main form I have two vital fields in the form of text boxes.
1. Division.
2. Employee ID.
I have a table which stores alongwith the Division and Employee ID, the days
worked and wages earned every week for 52 weeks in a year.
Based on entries made in the Division and Employee ID text boxes on the main
form, I want to display to the user all the entries absolutely related to
that particular employee of the respective division.
For this purpose, I have made a subform named as "subdetailform" [my main
form is named as just "mainform"], which is displayed on the main form of
course.
I have tried out the following code on the "On Lost Focus" property of the
Employee ID text box on the main form which, unfortunately, does not work to
anyone' satisfaction:
Me![subdetailform].Form.RecordSource = "SELECT tblRawData1.Type,
tblRawData1.Slno, tblRawData1.Name, tblRawData1.Days, tblRawData1.Amount
FROM tblRawData1 WHERE tblRawData1.Type = txtdivision.value AND
tblRawData1.Slno = txtempid.value ORDER BY tblRawData1.Record DESC;"
tblRawData1 => the table which stores the entries.
Type => the field in the table which actually corresponds to the division
text box on the main form.
Slno => the field in the table which corresponds to the Employee ID text box
on the main form.
Your help and assistance is solicited and is precious to me.
Sincerely yours,
Satadru.
I have a problem on unbound forms.
On the main form I have two vital fields in the form of text boxes.
1. Division.
2. Employee ID.
I have a table which stores alongwith the Division and Employee ID, the days
worked and wages earned every week for 52 weeks in a year.
Based on entries made in the Division and Employee ID text boxes on the main
form, I want to display to the user all the entries absolutely related to
that particular employee of the respective division.
For this purpose, I have made a subform named as "subdetailform" [my main
form is named as just "mainform"], which is displayed on the main form of
course.
I have tried out the following code on the "On Lost Focus" property of the
Employee ID text box on the main form which, unfortunately, does not work to
anyone' satisfaction:
Me![subdetailform].Form.RecordSource = "SELECT tblRawData1.Type,
tblRawData1.Slno, tblRawData1.Name, tblRawData1.Days, tblRawData1.Amount
FROM tblRawData1 WHERE tblRawData1.Type = txtdivision.value AND
tblRawData1.Slno = txtempid.value ORDER BY tblRawData1.Record DESC;"
tblRawData1 => the table which stores the entries.
Type => the field in the table which actually corresponds to the division
text box on the main form.
Slno => the field in the table which corresponds to the Employee ID text box
on the main form.
Your help and assistance is solicited and is precious to me.
Sincerely yours,
Satadru.