473,511 Members | 16,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combox Box -Help Please

28 New Member
Hello There,

I have combo box and getting data from table.

I wanna read data from combo box and auto fill the text box when form open or load.

For Example:

Combo have three value a;b;c and wanna display a,b,c in text box (Continuous Forms) when open or load the form.

Is it possible? If so, Can you please help me to do it?

Thank you in Advance.
Apr 3 '09 #1
4 1898
DonRayner
489 Recognized Expert Contributor
OK, a few assumptions here,

1. You are using two forms
2. Combo box on the first form
3. Textbox on the 2nd form

In the on open event for the 2nd form you would place code along these lines. You will need to substitute MyTextBox, 1stFormName and ListBoxName with the actual names from your project.

Expand|Select|Wrap|Line Numbers
  1. Me.MyTextBox = Forms!1stFromName.Form!ListBoxName
Apr 3 '09 #2
shimul
28 New Member
Thank you for your reply.

My combobox and textbox in the same form.

Another question:

Have table with data ( like a,b,c,d in column 1), want to read data from table and put in text box in continuous form.

like tble name "tbltest" and textbox name "txtbox".

now want to read first data from table and put in text box, then read second one and put in text box .....so on unit finish data in table.

Try to write following code, but couldn't fiqure out ----" New in VBA"
Expand|Select|Wrap|Line Numbers
  1. Set db = CurrentDb()
  2. Set rsLoc = db.OpenRecordset("tbltest", DB_OPEN_TABLE)
  3. 'Loop through records
  4. rsLoc.MoveFirst
  5. While Not rsLoc.EOF
  6.  
  7. txtbox =
Thx

*Please check attachment*
Attached Images
File Type: jpg Snapshot.jpg (7.5 KB, 183 views)
Apr 3 '09 #3
DonRayner
489 Recognized Expert Contributor
Hi shimul,

If they are on the same form then the code would be. And you would place it in the after update event for your listbox.

Expand|Select|Wrap|Line Numbers
  1. Me.MyTextBox = Me.ListBoxName
As for your other question, I see that you have already asked it in another post so that's where I'll post back.
Apr 3 '09 #4
NeoPa
32,557 Recognized Expert Moderator MVP
@shimul
There are two possibilities here :
  1. The data you want to display is also in your Record Source (table or query). Solution is easy. You bind the TextBox control to the Field you want.
  2. The data is not available and you want it to reflect a value dependent on the value of the ComboBox control. IMPOSSIBLE.
You're struggling with this because it is the latter I expect. An unbound control on a continuous form can only ever store one item at a time. As it is not a bound control it is not perpetuated across the various records but is a single, form level item.
Apr 4 '09 #5

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

Similar topics

1
1437
by: VIJAY KUMAR | last post by:
Hi all, I have a problem with combobox. I have 2 comboxes cmbcategory and cmbsubcategory. I intialized cmbcategory with sum values from database on Form_Load. when i select a vlue from the...
2
604
by: sebastien roupin | last post by:
Dear all, i'm newbies to .net (VB) development and i've got a little question.(i use microsoft visual studio to develop but i can code also) i created a form with a comboxbox. When i launch it, the...
4
1798
by: Charles A. Lackman | last post by:
Hello, I have a combox that I am trying to get to work in the following fashion. As you type in the combox that the item that matches what you are type is selected. as you type a last name:...
2
1535
by: Angela | last post by:
Hi, Before with comboboxes you could either select something from the lsit or you could type in a different value (one that is *not* in the list) to use. I have a combobox of cities and...
2
1352
by: SpiderFly | last post by:
I have a popup window where a user can select from a list of address records. When passing the details back to the calling screen i set all the address fields using code like this: ...
0
962
by: Kim Würtz | last post by:
Hi all How can I show a tooltip when I scroll down through the items in a combobox. First when I select an item in the list an event is fired, but I want the tooltip information to be shown...
3
1790
by: Alpha | last post by:
This is a Window based application. How do I get my combox listing to display in sorted order by DataMember? I inserted a blank row to the dataset table which is the datasrouce for the comboBox...
10
2618
by: Eva | last post by:
Does anyone know how i can connect my combobox to my acces DB? i have tried setting the datasource to a dataset but i cannot seem to locate the item property under the DataBindings list. I ended...
1
1308
by: neo1ra | last post by:
Hi, I'm doing a search combox to pop up and specific record. Everything is working fine until I make a change to the record that I'm working on and try to move to other record. A error message...
2
1238
by: summiyashaheen | last post by:
how to read the valuemember of the combox whose data source is a detaset. i have assigned the properties of displaymember and valuemember . display member cis visible but i cant get the value member...
0
7355
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
7423
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...
1
7081
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
7510
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
3225
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
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
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 ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
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.