473,385 Members | 1,780 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,385 software developers and data experts.

Urgent 1

123 100+
Hello,

My Front End is VB and Back End is Access.
I have two tables in my Database. One is Company table other is Branch table. Company contains ComID as primary key and ComName fields. Branch contains ComID as foreign key.

I have combobox on my form. Combobox should display company names but when i select company name from combox , ID of that company should be stored in Branch table. It means Display field is company name and value field is comID.

how to do coding of this in Visual Basic. Plz tell me.

Thanks
Feb 22 '07 #1
5 1005
samycbe
83
Dear Friend,

1. Just select the company names and display it in combo box.
2. Have one invisible textbox named txtinvcompid
3.on combo box click or change event write the code like
select compid from company where compname =' " & cbocomp & " ' "
4. store that value to the invisble text box


is it ok?

samy
Feb 22 '07 #2
vijaydiwakar
579 512MB
Hello,

My Front End is VB and Back End is Access.
I have two tables in my Database. One is Company table other is Branch table. Company contains ComID as primary key and ComName fields. Branch contains ComID as foreign key.

I have combobox on my form. Combobox should display company names but when i select company name from combox , ID of that company should be stored in Branch table. It means Display field is company name and value field is comID.

how to do coding of this in Visual Basic. Plz tell me.

Thanks

u have to use combobox's itemdata to store the id
its combobox's hidden property
Feb 22 '07 #3
Shailja
123 100+
Dear Friend,

1. Just select the company names and display it in combo box.
2. Have one invisible textbox named txtinvcompid
3.on combo box click or change event write the code like
select compid from company where compname =' " & cbocomp & " ' "
4. store that value to the invisble text box


is it ok?

samy

No, I want complete coding.
Feb 22 '07 #4
samycbe
83
on form load......

1. create combobox named cbocomp
2. create text box txtinvcomp

cbocomp.clear
sql = " select compname from company order by compname"
rs.open,sql,constr
do while not rs.eof
cbocomp.additem rs!compname
rs.movenext
loop

on cbocomp_click
sql = " select compid from company where compname =' " & cbocomp &" ' "
rs.open sql,constr
if not rs.eof then
txtinvcomp = rs!compid
end if

still not clear call me 91 9944099800 or mail me
v.arumugasamy@saipem-india.com i will send file

samy
Feb 22 '07 #5
Shailja
123 100+
on form load......

1. create combobox named cbocomp
2. create text box txtinvcomp

cbocomp.clear
sql = " select compname from company order by compname"
rs.open,sql,constr
do while not rs.eof
cbocomp.additem rs!compname
rs.movenext
loop

on cbocomp_click
sql = " select compid from company where compname =' " & cbocomp &" ' "
rs.open sql,constr
if not rs.eof then
txtinvcomp = rs!compid
end if

still not clear call me 91 9944099800 or mail me
v.arumugasamy@saipem-india.com i will send file

samy
Got it. Thanks a lot
Feb 22 '07 #6

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

Similar topics

3
by: Rob | last post by:
I have a form - when you click the submit button, it appends a variable to the URL (e.g. xyz.cgi?inputID=some_dynamic_variable) It also opens a new page. Now, that some_dynamic_variable is...
9
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
28
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
7
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
33
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
8
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
7
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.