473,721 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12593
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_AfterUp date()

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.go ogle.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_k ha.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
34319
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 the page to auto-refresh every 4 seconds....if the user un-checks the checkbox, I'd like to turn off the auto refresh. The page is as follows:
1
13956
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 page the way I want. Does anybody know a solution for this? First of all, the code I am using: CSS ------- body {
5
6112
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 of the screen. I want it to only extend as far as it needs to to nicely contain the content within (a couple of links). Is width: auto the wrong property to do this? Is Mozilla rendering the style wrong?
20
2862
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
3274
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 I change 'auto' to 0 for left and right margin values; I have to leave those at 'auto'.. so I would like to know what exactly means 'auto' -- what value it represents exactly (and does it apply for all elements/values you might apply 'auto' to?)
22
3075
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 like that: int main(char argc, char *argv, char *env) { try { auto Exception mainException(1); mainException.setErrNo(42);
2
3078
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 ("auto") in JavaScript - however instead of getting "auto" value, I get calculated height. In IE and Opera it simply returns "auto". Any ideas how to check in Firefox if element height was set to "auto" ? I'll be grateful for any help.
1
2980
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 table to dictate the height to the content div instead of popping out of the bottom of the content div. Seems pretty simple but too complicated for me I guess. If you know how to achieve this please share. Thanks, J /*begin code*/
1
5165
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 FF, IE6 and IE7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> Employee Listing </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords"...
21
6347
by: JOYCE | last post by:
Look the subject,that's my problem! I hope someone can help me, thanks
0
9215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9131
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.