473,473 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to update a field based on combobox selection?

1 New Member
I'm sorry, I know this has been asked a million times, but am completely new to access and need idiot proof help. I have a database and I am struggling to get a field to update based on a combobox selection. I have

tbl_Hazards - fields are numerous, inc risk rating and priority.
tbl_Risks - fields are key, risk rating, priority
frm_Hazards.

On the form I have a Risk Rating combobox that sources data from tbl_Risks, then stores data in tbl_Hazards.

I want, based on the selection from the combobox the priority field (text box) to update with the appropriate value. e.g. Risk Rating = High, Priority = High.

I can get the priority text box to update based on the combobox selection if I set the text box control source to =Risk Rating.column2 but it will not update the priority field in tbl_hazards (as it is no longer bound to tbl_Hazards).

I have tried the AfterUpdate in the risk rating combobox Private Sub Risk_Rating_AfterUpdate()
Me.Priority = Me!Risk_Rating.Column(1)
Me.Refresh
End Sub

and keep the text box control source linked to the priority field, but it does not seem to do anything...i have no idea where I am going wrong, can someone please help...
Dec 8 '10 #1
1 9084
beacon
579 Contributor
Hi Emily,

Check out this website. I refer to this from time to time when I need to implement cascading lists/textboxes/comboboxes.

I think you're on the right track with what you've tried so far, but since you're trying to grab a value in a column that isn't bound, I would recommend using the SQL implementation on the site I provided so you can pin point the exact column you want to appear in your combobox.

Hope this helps,
beacon
Dec 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: pkinville | last post by:
ok, this is gonna seem stupid, but it has been stumping me all afternoon. I have two fields on a HTML page. HTML looks like this... <html> <head> <title>New Page 3</title> </head> <body>
1
by: thegame | last post by:
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls Hello, I have an interesting dilemma. I have an ASPX page with two user controls (two ASCXs). ...
0
by: ROO | last post by:
Hi Everyone, I have a database table that have 4 field( C1, C2, M1, M2) on my form i have two combo box ComboC and ComboM C1 C2 M1 M2 1 ...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
4
gcoaster
by: gcoaster | last post by:
Hello! I have a dilemma I have a form that is bound to a table = tblCALLDETAILS I have a field in the table that is on the the form called = email, that is a textbox txtClientEmail ...
11
by: billa856 | last post by:
Hi, I have project in MS Access.In that I have one form in which there is one combobox .I want to know when I select an item from that combobox and click on submit button then it should open a...
4
by: Mtek | last post by:
Hi, We have a combo box on our page, which gets populated via a MySQL Query in PHP. What we want to do is to print the values on the page in a table that correspond the to selection from the...
10
by: dkyadav80 | last post by:
<html> /// here what shoud be java script for: ->when script run then not display all input text field only display selection field. ->when user select other value for institute only this...
1
by: Rosie | last post by:
I have a main form with header info w/ 'tHeader' as the control source. I have a subform with 'tDetail' as a control source. They're strung together by a field named MA_ID. This works...
0
by: perdijc | last post by:
The wizard to create dataset, automatically creates a method to update table if the dataset is based on table. If i create a dataset based on sotored procedure where this is based on more one...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
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...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.