A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Easy Fill In but I don't get it



 
 
Thread Tools Display Modes
  #1  
Old February 22nd, 2007, 04:37 PM posted to microsoft.public.access.forms
LindaC
external usenet poster
 
Posts: 69
Default 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  
Old February 22nd, 2007, 05:00 PM posted to microsoft.public.access.forms
Al Campagna
external usenet poster
 
Posts: 647
Default 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  
Old February 22nd, 2007, 05:34 PM posted to microsoft.public.access.forms
LindaC
external usenet poster
 
Posts: 69
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.