If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Combo Box (1st) Populating Text Box (2nd) Field
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. Then the next step is Description Combo Box, that will populate Cost Center, Acct, Category automatically. Any suggestion? I am lil rusty in VBA coding. Sincerely, AccessRookie =) "Scott McDaniel" wrote: 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 Updating your table If your TimeEntyr form is based on your TimeCard table, then Access will update it for you "AccessRookie" wrote in message ... 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 =) |
#2
|
|||
|
|||
I solved my own issue by using this site:
http://www.access-programmers.co.uk/...ad.php?t=73261 I hope that will help others. "AccessRookie" wrote: 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. Then the next step is Description Combo Box, that will populate Cost Center, Acct, Category automatically. Any suggestion? I am lil rusty in VBA coding. Sincerely, AccessRookie =) "Scott McDaniel" wrote: 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 Updating your table If your TimeEntyr form is based on your TimeCard table, then Access will update it for you "AccessRookie" wrote in message ... 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 =) |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Design help, please | SillySally | Using Forms | 27 | March 6th, 2005 04:11 AM |
Syntax needed to get needed reports | Frank Lueder | New Users | 15 | January 6th, 2005 08:39 AM |
Outline | Renee Hendershott | Page Layout | 2 | December 25th, 2004 02:49 PM |
Text Form Field Ref in Footer Won't Update on Screen | StarWine | General Discussion | 3 | December 6th, 2004 06:17 PM |
Concatenatd fields in a query for a searching form | Marc | Running & Setting Up Queries | 8 | October 19th, 2004 08:49 PM |