473,503 Members | 1,657 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to insert the value from combobox in a table

44 New Member
sir,
i have 2 tables namely tblexam and subject.
in tblexam fields r questionno,subcode,question,options and answer.
in subject table fields r subcode,subname.
i created form using wizard from tblexam taking all the fields except subcode.
in the form i created a combobox for subname from the subject table.
when i select some subname in the form ,.that subcode from the subject table has to be inserted in the tblexam subcode field.how can i do this
thanks in advance.
Apr 3 '07 #1
3 3816
Rabbit
12,516 Recognized Expert Moderator MVP
Set the control source of the combobox to subcode.
Apr 3 '07 #2
neelesh kumar
44 New Member
my combobox name is combo69.i have a table named tblexam.
i want to insert the value of combobox into the tblexam subcode field.
tblexam consists of questionno,question,subcode,options fields.
combobox is designed from subject table to lookup the values in table consisting of subname,subcode fields.
i wrote the code as
private sub combo69_afterupdate()
subcode = DLookup("subcode", "Table3", "[subname]= '" & Combo69 & "' ")
DoCmd.RunSQL "update tblexam set tblexam.subcode= 'subcode' where questionno = Me.questionno"

the code is not working
please help me
Apr 3 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
No need for code, just set the control source property of the combobox to subcode.
Apr 3 '07 #4

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

Similar topics

2
8547
by: Bill | last post by:
I'm having what seems to me to be an odd problem. Perhaps there is some explanation, but don't know at this point. Basically I have a form that tracks memberships and donations. The main form...
3
4481
by: Nicolae Fieraru | last post by:
Hi All, I have a problem and I can't figure out how to solve it. My database has three tables: tblCustomers, with CustomerId and CustomerName tblProducts, with ProductId and ProductCode...
2
12869
by: John Tyce | last post by:
When a button is clicked, a date is inserted or added into a combo box like this : ComboBox.Items.Add(string) or ComboBox.Items.Insert(0,string); Either way, the new string does not show up in the...
0
4778
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
2
8646
by: shumaker | last post by:
I have a combobox that is very much like the one found in the RSS project here: http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/ My projectNameComboBox basically is filled with a...
7
2366
by: grummanf6f | last post by:
Hello Gurus, this probably is real simple for you but for me it's a bummer. I have one table in which I have basic data collected of schools. I have another data that is detailed info on the...
2
7111
by: DesCF | last post by:
I have a textbox and a combobox on a toolstrip. The user enters either an ID in the textbox or selects a name from the combobox. When the user selects a name from the combobox the textbox is...
5
1580
by: raajakumars | last post by:
urgent!!!!!!! kindly please anyone help me....... actualy i am newbe to vb.net i need data to be inserted in to my table like this... sitenm cdate wrknm nowrk totwg tamiz palace...
2
14717
by: =?Utf-8?B?RHJEQkY=?= | last post by:
I understand that the Value put into a DataGridViewComboBoxCell has to be a member of the Items list or an exception is thrown. I also understand that you can override that exception by handling...
19
9080
by: obtrs | last post by:
I have some code for drop down its not working it gives the errors every thing looks fine to me help me out. Errors Notice: Undefined index: from in C:\wamp\www\site\booking.php on line 6 ...
0
7198
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
7271
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
7319
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...
0
7449
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
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4998
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...
0
4666
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
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
373
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.