Combo Box & Text Box

A

AccessRookie

Help me, please! I am putting together an automated Time Card Entry Form. I
have the following fields on this form as follows:
1. Week Ending: manual entry with "mm/dd/yyyy" date format.
2. Employee Number: combo box that will populate next field, Employee
Name, after user select correct Employee Number.
3. Employee Name: Text Box will appear "LastName, FirstName" order.
4. Description: combo box containing a list of labor description that has
associated fields as follows.
5. Cost Center: Text Box will populate after selecting Description.
6. Acct: Text Box will populate after selecting Description.
7. Category: Text Box will populate after selecting Description.
8. Pay Type: Combo Box to eliminate data entry errors.
9. Allocation: Free form, to type comments.
10. Days of Week: Sat, Sun, Mon, Tue, Wed, Thu, Fri
11. Regular: totals of regular hours worked
12. Overtime: totals of overtime hours worked
13. Vacation: totals of vacation hours taken
14. Holiday: totals of holiday hours taken
15. Sick: totals of sick hours taken
16. Personal: totals of personal hours taken

Here are my tables:
1. tblEmployees:
1) LastName = Text
2) FirstName = Text
3) EmployeeId = Number (Primary Key)
4) EmployeeClass = Text
5) EmployeeType = Text

2. tblAccounts:
1) CostCenter = Number
2) AcctNo = Number
3) Category = Text
4) AcctName = Text
5) AcctDescription = Text
6) PayType = Text

3. tblPayType:
1) PayType = Text
2) Description = Text

4. tblRegRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) HourlyRate = Number
5) AnnualRate = Number

5. tblOtRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) RegHourlyRate = Number
5) OTHourlyRate = Number
6) AnnualRate = Number

6. tblDdRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) RegHourlyRate = Number
5) DDHourlyRate = Number
6) AnnualRate = Number

7. tblTimecard:
1) LastName = Text
2) FirstName = Text
3) EmployeeId = Number
4) PayPeriod = Date/Time
5) EmployeeClass = Text
6) EmployeeType = Text
7) SAT = Number
8) SUN = Number
9) MON = Number
10) TUE = Number
11) WED = Number
12) THU = Number
13) FRI = Number
14) CostCenter = Number
15) AcctNo = Number
16) Category = Text
17) AcctName = Text
18) AcctDescription = Text
19) PayType = Text
20) Allocation = Text
21) TotalRegHrs = Number
22) TotalOTHrs = Number
23) TotalVacHrs = Number
24) TotalHolHrs = Number
25) TotalSickHrs = Number
26) TotalPersHrs = Number

Here is my question MS Access 2002: I have a Combo Box, EmpNum(contains
employee number) then I want to populate the Text Box, EmpName(contains
employee names associated with employee number). On the EmpNum Combo Box
properties:
1. Row Source Type: Table/Query
2. Row Source: Sel_EmpNum query(see below for query)
SELECT
tblEmployees.EmployeeId,
Trim([LastName] & ", " & [FirstName]) AS EmpName
FROM tblEmployees
GROUP BY tblEmployees.EmployeeId, Trim([LastName] & ", " & [FirstName])
ORDER BY Trim([LastName] & ", " & [FirstName]);

3. After Update: [Event Procedure] -- (what VBA code do I need to put in
this section)?

4. What code do I put into TimeEntry form to make it update to TimeCard
table after selecting & entering all needed data?

It's been a while since I have done Access development.
Sincerely,
AccessRookie =)
 
S

Scott McDaniel

RE: Populating the EmpName:

<in the AfterUpdate event>
Me.EmpName = Me.EmpNum.Column(1)
'/Note: this assumes that you have set the EmpNum .columncount = 2 ...
columns are zero based, therefore the First column is Column(0), second is
Column(1) etc

RE: Updating your table
If your TimeEntyr form is based on your TimeCard table, then Access will
update it for you


AccessRookie said:
Help me, please! I am putting together an automated Time Card Entry Form.
I
have the following fields on this form as follows:
1. Week Ending: manual entry with "mm/dd/yyyy" date format.
2. Employee Number: combo box that will populate next field, Employee
Name, after user select correct Employee Number.
3. Employee Name: Text Box will appear "LastName, FirstName" order.
4. Description: combo box containing a list of labor description that
has
associated fields as follows.
5. Cost Center: Text Box will populate after selecting Description.
6. Acct: Text Box will populate after selecting Description.
7. Category: Text Box will populate after selecting Description.
8. Pay Type: Combo Box to eliminate data entry errors.
9. Allocation: Free form, to type comments.
10. Days of Week: Sat, Sun, Mon, Tue, Wed, Thu, Fri
11. Regular: totals of regular hours worked
12. Overtime: totals of overtime hours worked
13. Vacation: totals of vacation hours taken
14. Holiday: totals of holiday hours taken
15. Sick: totals of sick hours taken
16. Personal: totals of personal hours taken

Here are my tables:
1. tblEmployees:
1) LastName = Text
2) FirstName = Text
3) EmployeeId = Number (Primary Key)
4) EmployeeClass = Text
5) EmployeeType = Text

2. tblAccounts:
1) CostCenter = Number
2) AcctNo = Number
3) Category = Text
4) AcctName = Text
5) AcctDescription = Text
6) PayType = Text

3. tblPayType:
1) PayType = Text
2) Description = Text

4. tblRegRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) HourlyRate = Number
5) AnnualRate = Number

5. tblOtRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) RegHourlyRate = Number
5) OTHourlyRate = Number
6) AnnualRate = Number

6. tblDdRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) RegHourlyRate = Number
5) DDHourlyRate = Number
6) AnnualRate = Number

7. tblTimecard:
1) LastName = Text
2) FirstName = Text
3) EmployeeId = Number
4) PayPeriod = Date/Time
5) EmployeeClass = Text
6) EmployeeType = Text
7) SAT = Number
8) SUN = Number
9) MON = Number
10) TUE = Number
11) WED = Number
12) THU = Number
13) FRI = Number
14) CostCenter = Number
15) AcctNo = Number
16) Category = Text
17) AcctName = Text
18) AcctDescription = Text
19) PayType = Text
20) Allocation = Text
21) TotalRegHrs = Number
22) TotalOTHrs = Number
23) TotalVacHrs = Number
24) TotalHolHrs = Number
25) TotalSickHrs = Number
26) TotalPersHrs = Number

Here is my question MS Access 2002: I have a Combo Box, EmpNum(contains
employee number) then I want to populate the Text Box, EmpName(contains
employee names associated with employee number). On the EmpNum Combo Box
properties:
1. Row Source Type: Table/Query
2. Row Source: Sel_EmpNum query(see below for query)
SELECT
tblEmployees.EmployeeId,
Trim([LastName] & ", " & [FirstName]) AS EmpName
FROM tblEmployees
GROUP BY tblEmployees.EmployeeId, Trim([LastName] & ", " & [FirstName])
ORDER BY Trim([LastName] & ", " & [FirstName]);

3. After Update: [Event Procedure] -- (what VBA code do I need to put in
this section)?

4. What code do I put into TimeEntry form to make it update to TimeCard
table after selecting & entering all needed data?

It's been a while since I have done Access development.
Sincerely,
AccessRookie =)
 
A

AccessRookie

I added your recommend code, but then it gave me this Error Message after
selecting Employee Number Combo Box:
The value you entered isn't valid for this field.

For example, you may have entered text in a numeric field or a number that
is larger than the FieldSize Setting permits.

All of the fields that are on this form is from tblTimecard table. Your
code suggestion made sense. What am I missing that makes this error message
display? Need more help.

Scott McDaniel said:
RE: Populating the EmpName:

<in the AfterUpdate event>
Me.EmpName = Me.EmpNum.Column(1)
'/Note: this assumes that you have set the EmpNum .columncount = 2 ...
columns are zero based, therefore the First column is Column(0), second is
Column(1) etc

RE: Updating your table
If your TimeEntyr form is based on your TimeCard table, then Access will
update it for you


AccessRookie said:
Help me, please! I am putting together an automated Time Card Entry Form.
I
have the following fields on this form as follows:
1. Week Ending: manual entry with "mm/dd/yyyy" date format.
2. Employee Number: combo box that will populate next field, Employee
Name, after user select correct Employee Number.
3. Employee Name: Text Box will appear "LastName, FirstName" order.
4. Description: combo box containing a list of labor description that
has
associated fields as follows.
5. Cost Center: Text Box will populate after selecting Description.
6. Acct: Text Box will populate after selecting Description.
7. Category: Text Box will populate after selecting Description.
8. Pay Type: Combo Box to eliminate data entry errors.
9. Allocation: Free form, to type comments.
10. Days of Week: Sat, Sun, Mon, Tue, Wed, Thu, Fri
11. Regular: totals of regular hours worked
12. Overtime: totals of overtime hours worked
13. Vacation: totals of vacation hours taken
14. Holiday: totals of holiday hours taken
15. Sick: totals of sick hours taken
16. Personal: totals of personal hours taken

Here are my tables:
1. tblEmployees:
1) LastName = Text
2) FirstName = Text
3) EmployeeId = Number (Primary Key)
4) EmployeeClass = Text
5) EmployeeType = Text

2. tblAccounts:
1) CostCenter = Number
2) AcctNo = Number
3) Category = Text
4) AcctName = Text
5) AcctDescription = Text
6) PayType = Text

3. tblPayType:
1) PayType = Text
2) Description = Text

4. tblRegRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) HourlyRate = Number
5) AnnualRate = Number

5. tblOtRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) RegHourlyRate = Number
5) OTHourlyRate = Number
6) AnnualRate = Number

6. tblDdRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) RegHourlyRate = Number
5) DDHourlyRate = Number
6) AnnualRate = Number

7. tblTimecard:
1) LastName = Text
2) FirstName = Text
3) EmpName = Text
4) EmployeeId = Number
5) PayPeriod = Date/Time
6) EmployeeClass = Text
7) EmployeeType = Text
8) SAT = Number
9) SUN = Number
10) MON = Number
11) TUE = Number
12) WED = Number
13) THU = Number
14) FRI = Number
15) CostCenter = Number
16) AcctNo = Number
17) Category = Text
18) AcctName = Text
19) AcctDescription = Text
20) PayType = Text
21) Allocation = Text
22) TotalRegHrs = Number
23) TotalOTHrs = Number
24) TotalVacHrs = Number
25) TotalHolHrs = Number
26) TotalSickHrs = Number
27) TotalPersHrs = Number

Here is my question MS Access 2002: I have a Combo Box, EmpNum(contains
employee number) then I want to populate the Text Box, EmpName(contains
employee names associated with employee number). On the EmpNum Combo Box
properties:
1. Row Source Type: Table/Query
2. Row Source: Sel_EmpNum query(see below for query)
SELECT
tblEmployees.EmployeeId,
Trim([LastName] & ", " & [FirstName]) AS EmpName
FROM tblEmployees
GROUP BY tblEmployees.EmployeeId, Trim([LastName] & ", " & [FirstName])
ORDER BY Trim([LastName] & ", " & [FirstName]);

3. After Update: [Event Procedure] -- (what VBA code do I need to put in
this section)?

4. What code do I put into TimeEntry form to make it update to TimeCard
table after selecting & entering all needed data?

It's been a while since I have done Access development.
Sincerely,
AccessRookie =)
 
A

AccessRookie

I found my answer on another site that solved this Combo Box & Text Box issue
on data entry form. Here is the URL:
http://www.access-programmers.co.uk/forums/showthread.php?t=73261

Hopefully that will help others on this site if they run across this same
issue that I had.

AccessRookie said:
I added your recommend code, but then it gave me this Error Message after
selecting Employee Number Combo Box:
The value you entered isn't valid for this field.

For example, you may have entered text in a numeric field or a number that
is larger than the FieldSize Setting permits.

All of the fields that are on this form is from tblTimecard table. Your
code suggestion made sense. What am I missing that makes this error message
display? Need more help.

Scott McDaniel said:
RE: Populating the EmpName:

<in the AfterUpdate event>
Me.EmpName = Me.EmpNum.Column(1)
'/Note: this assumes that you have set the EmpNum .columncount = 2 ...
columns are zero based, therefore the First column is Column(0), second is
Column(1) etc

RE: Updating your table
If your TimeEntyr form is based on your TimeCard table, then Access will
update it for you


AccessRookie said:
Help me, please! I am putting together an automated Time Card Entry Form.
I
have the following fields on this form as follows:
1. Week Ending: manual entry with "mm/dd/yyyy" date format.
2. Employee Number: combo box that will populate next field, Employee
Name, after user select correct Employee Number.
3. Employee Name: Text Box will appear "LastName, FirstName" order.
4. Description: combo box containing a list of labor description that
has
associated fields as follows.
5. Cost Center: Text Box will populate after selecting Description.
6. Acct: Text Box will populate after selecting Description.
7. Category: Text Box will populate after selecting Description.
8. Pay Type: Combo Box to eliminate data entry errors.
9. Allocation: Free form, to type comments.
10. Days of Week: Sat, Sun, Mon, Tue, Wed, Thu, Fri
11. Regular: totals of regular hours worked
12. Overtime: totals of overtime hours worked
13. Vacation: totals of vacation hours taken
14. Holiday: totals of holiday hours taken
15. Sick: totals of sick hours taken
16. Personal: totals of personal hours taken

Here are my tables:
1. tblEmployees:
1) LastName = Text
2) FirstName = Text
3) EmployeeId = Number (Primary Key)
4) EmployeeClass = Text
5) EmployeeType = Text

2. tblAccounts:
1) CostCenter = Number
2) AcctNo = Number
3) Category = Text
4) AcctName = Text
5) AcctDescription = Text
6) PayType = Text

3. tblPayType:
1) PayType = Text
2) Description = Text

4. tblRegRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) HourlyRate = Number
5) AnnualRate = Number

5. tblOtRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) RegHourlyRate = Number
5) OTHourlyRate = Number
6) AnnualRate = Number

6. tblDdRate:
1) EmployeeId = Number (Primary Key)
2) EmployeeType = Text
3) PayType = Text
4) RegHourlyRate = Number
5) DDHourlyRate = Number
6) AnnualRate = Number

7. tblTimecard:
1) LastName = Text
2) FirstName = Text
3) EmpName = Text
4) EmployeeId = Number
5) PayPeriod = Date/Time
6) EmployeeClass = Text
7) EmployeeType = Text
8) SAT = Number
9) SUN = Number
10) MON = Number
11) TUE = Number
12) WED = Number
13) THU = Number
14) FRI = Number
15) CostCenter = Number
16) AcctNo = Number
17) Category = Text
18) AcctName = Text
19) AcctDescription = Text
20) PayType = Text
21) Allocation = Text
22) TotalRegHrs = Number
23) TotalOTHrs = Number
24) TotalVacHrs = Number
25) TotalHolHrs = Number
26) TotalSickHrs = Number
27) TotalPersHrs = Number

Here is my question MS Access 2002: I have a Combo Box, EmpNum(contains
employee number) then I want to populate the Text Box, EmpName(contains
employee names associated with employee number). On the EmpNum Combo Box
properties:
1. Row Source Type: Table/Query
2. Row Source: Sel_EmpNum query(see below for query)
SELECT
tblEmployees.EmployeeId,
Trim([LastName] & ", " & [FirstName]) AS EmpName
FROM tblEmployees
GROUP BY tblEmployees.EmployeeId, Trim([LastName] & ", " & [FirstName])
ORDER BY Trim([LastName] & ", " & [FirstName]);

3. After Update: [Event Procedure] -- (what VBA code do I need to put in
this section)?

4. What code do I put into TimeEntry form to make it update to TimeCard
table after selecting & entering all needed data?

It's been a while since I have done Access development.
Sincerely,
AccessRookie =)
 

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