473,395 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Auto-Populating Fields based on a combo box in another field.

sao
I am currently using Access 2000.

In my table it is the following fields that are set up:

1 - Staff Name
2 - Department

This table is already populated with 100+ records (staff along with
department.)

I have a form set up that has a combo box that allows the user to
select the "Staff Name" and I have managed to get it to automatically
complete the "Department" field of the form with the relevant staff
member's department.

This was done by changing the "control source" property to the below:

=[Staff Name].Column(1)

....where "Staff Name" is column "0" of the data table, and Department
is Column 1 (as above). This results in corresponding "Department" to
whichever "Staff Name" is chosen from the table.

THE PROBLEM:
************

When selecting a member of staff from the drop down list of the combo
box, although the "Department" field shows that staff member's
Department, it does not show in the new table I created. In other
words, anything that is generated automatically based on the selection
of the combo box is not being written to the table.

I am experiencing the same problem with a different field that I have
where the date for that field is calculated automatically, the date
that shows up in the form is not saved to the table so there's no date
data when it comes to reporting!
If this doesn't make sense, its probably my wording, apologies in
advance for that!

Nevertheless, any help would be very gratefully recieved!!
Nov 12 '05 #1
3 12575
Hello,

For new records, try using the AfterUpdate event of the combo to set
the value of the control on the subform

Something like

Sub MyCombo_AfterUpdate()

MyControl =[Staff Name].Column(1)

End Sub

For existing records you'll probably need to write an update query

HTH

Ed Marzan
NYC
sa*@kha.org.uk (sao) wrote in message news:<5d**************************@posting.google. com>...
I am currently using Access 2000.

In my table it is the following fields that are set up:

1 - Staff Name
2 - Department

This table is already populated with 100+ records (staff along with
department.)

I have a form set up that has a combo box that allows the user to
select the "Staff Name" and I have managed to get it to automatically
complete the "Department" field of the form with the relevant staff
member's department.

This was done by changing the "control source" property to the below:

=[Staff Name].Column(1)

...where "Staff Name" is column "0" of the data table, and Department
is Column 1 (as above). This results in corresponding "Department" to
whichever "Staff Name" is chosen from the table.

THE PROBLEM:
************

When selecting a member of staff from the drop down list of the combo
box, although the "Department" field shows that staff member's
Department, it does not show in the new table I created. In other
words, anything that is generated automatically based on the selection
of the combo box is not being written to the table.

I am experiencing the same problem with a different field that I have
where the date for that field is calculated automatically, the date
that shows up in the form is not saved to the table so there's no date
data when it comes to reporting!
If this doesn't make sense, its probably my wording, apologies in
advance for that!

Nevertheless, any help would be very gratefully recieved!!

Nov 12 '05 #2
sao

Thanks very much for your advice, I have tried what you suggested with
no luck. Still no data in the field when looking at the table.

I would be grateful if you would give me more info on the update
statement you mentioned?

Thanks
sao

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
Well, since I generally have no life send me a copy of your db with
the name of the form in question and I'll have a look. :)

It will be easier for both of us. If I solve your problem I will post
the code to the group.

HTH

EM
sao <sao@_NO_SPAM_kha.org.uk> wrote in message news:<3f***********************@news.frii.net>...
Thanks very much for your advice, I have tried what you suggested with
no luck. Still no data in the field when looking at the table.

I would be grateful if you would give me more info on the update
statement you mentioned?

Thanks
sao

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lew | last post by:
Hi all, I'm trying to create a page that has a user-selectable page auto-refresh option (IE 5.5). Essentially, it's a page that contains a checkbox, when the user checks the checkbox, I'd like...
1
by: Glabbeek | last post by:
I'm changing the layout of my site. Instead of using tables, I will use DIVs. It's working fine, except for 1 thing: In IE6 some DIVs are not the correct width. Mozilla and Opera are showing the...
5
by: Robert Downes | last post by:
I'm using the following in a page that I'm testing in Mozilla: p.actionLinkBlock {border: 1px #000000 dashed; padding: 0.2cm; width: auto} But the dashed border is extending to the right-edge...
20
by: Vijay Kumar R. Zanvar | last post by:
Hello, Unlike register, auto keyword can not be used to declare formal parameter(s). Is there any specific reason for this? Kind regards, Vijay Kumar R. Zanvar
5
by: maya | last post by:
at work they decided to center divs thus: body {text-align:center} #content {width: 612px; text-align:left; margin: 0 auto 0 auto; } this works fine in IE & FF, EXCEPT in FF it doesn't work if...
22
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly...
2
by: Piotr K | last post by:
Hi, I've encountered a strange problem with Firefox which I don't have any idea how to resolve. To the point: I've <divelement with a style "height: auto" and I want to retrieve this value...
1
by: neridaj | last post by:
Hello, I've found a few postings of this problem but none of the answers seem to fix my problem. I have a content div wrapped around a left floated image and a right floated table. I want the...
1
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in...
21
by: JOYCE | last post by:
Look the subject,that's my problem! I hope someone can help me, thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.