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
|
|||
|
|||
Easy Fill In but I don't get it
I have a field Department in my tblArchive which is a drop down in my form.
If I select Accounting as the field I would like a Cost Centre field to be automatically filled in with the corresponding number. Not sure how this should be set up. Please and thank you. |
#2
|
|||
|
|||
Easy Fill In but I don't get it
Linda,
Add the CostCentre field to your combo... (ex. cboDepartment) I'd set it up like this DeptID Dept CostCentre 12 Accounting 123-526 22 Finance 714-524 etc... Combo setup... ControlSource = DeptID NoOfColumns = 3 ColumnWidths = 0" ; 1.5" ; 1" ListWidth = 2.5" LimitToList = Yes What this does is... the user selects a department by name (the easiest method), the combo displays the Dept name, but...the combo really stores the DeptID in the "bound" DeptID field. That takes care of the selection... Using the AfterUpdate event of the combo.... Me.CostCentre = cboDepartment.Column(2) (combo cols are number left to right... 0,1,2,3, etc...) But... you really don't need to save the CostCentre, unless CostCentre numbers might ever change. If it's always the same, you can just display the CostCentre on the form, and re-associate Dept to CostCentre in any subsequent form, query, and report... via the captured DeptID. In that case, just an unbound calculated field for CostCentre with a ControlSource of... =cboDepartment.Column(2) will always "display" the correct CostCentre. If you're in doubt as to which method to use... use the first method. - hth Al Campagna . Candia Computer Consulting . Candia, NH USA Microsoft Access MVP http://home.comcast.net/~cccsolutions "Find a job that you love, and you'll never work a day in your life." "LindaC" wrote in message ... I have a field Department in my tblArchive which is a drop down in my form. If I select Accounting as the field I would like a Cost Centre field to be automatically filled in with the corresponding number. Not sure how this should be set up. Please and thank you. |
#3
|
|||
|
|||
Easy Fill In but I don't get it
Thanks for the info, immediatly got it, sometimes you just too long at
things. "Al Campagna" wrote: Linda, Add the CostCentre field to your combo... (ex. cboDepartment) I'd set it up like this DeptID Dept CostCentre 12 Accounting 123-526 22 Finance 714-524 etc... Combo setup... ControlSource = DeptID NoOfColumns = 3 ColumnWidths = 0" ; 1.5" ; 1" ListWidth = 2.5" LimitToList = Yes What this does is... the user selects a department by name (the easiest method), the combo displays the Dept name, but...the combo really stores the DeptID in the "bound" DeptID field. That takes care of the selection... Using the AfterUpdate event of the combo.... Me.CostCentre = cboDepartment.Column(2) (combo cols are number left to right... 0,1,2,3, etc...) But... you really don't need to save the CostCentre, unless CostCentre numbers might ever change. If it's always the same, you can just display the CostCentre on the form, and re-associate Dept to CostCentre in any subsequent form, query, and report... via the captured DeptID. In that case, just an unbound calculated field for CostCentre with a ControlSource of... =cboDepartment.Column(2) will always "display" the correct CostCentre. If you're in doubt as to which method to use... use the first method. - hth Al Campagna . Candia Computer Consulting . Candia, NH USA Microsoft Access MVP http://home.comcast.net/~cccsolutions "Find a job that you love, and you'll never work a day in your life." "LindaC" wrote in message ... I have a field Department in my tblArchive which is a drop down in my form. If I select Accounting as the field I would like a Cost Centre field to be automatically filled in with the corresponding number. Not sure how this should be set up. Please and thank you. |
Thread Tools | |
Display Modes | |
|
|