473,513 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access - Form list Box data to table

2 New Member
Hi everyone,

I have a form in my database with a list box. The list box values come from a separate table created just to store values for the list box.
What I want to happen is for the value that a user selects from the list box (in the form) to appear exactly as it is in the main table the form is being used to enter data into.
This is working, but the text values in the list box are being entered into the main table as numbers. For example, selecting the first text value in the list box would produce a value of '1' in the main table.
How do I get it to display the actual text value instead?

Thanks!
Jun 8 '11 #1
4 3391
Mihail
759 Contributor
The value entered in your TextBox is the value for FIRST column in your ListBox (I think here are the IDs for ListBox items and this field is hide in the ListBox.

Use
TextBox = ListBox.Columns(n)

where "n" is the number of column in your table (and in ListBox too). "n" for first column is zero.

Good luck !
Jun 9 '11 #2
DenamP
2 New Member
Thanks Mihail. I am afraid I am a bit rusty with Access, where do I enter
"TextBox"=[ListBox].[Columns]("9")?

Thanks!
Jun 9 '11 #3
Mihail
759 Contributor
TextBoxName = ListBoxName.Columns(9)
Without quotes because the .Columns argument is a number, not a string.
Jun 10 '11 #4
Mihail
759 Contributor
DenamP !
Sorry for my misunderstood. There are 2 ways to solve that (at least).

One is to set the TextBox control source in the Property Sheet pane:

=[ListBoxName].[Column](9)

The second is to use the Click event for your list box:

Expand|Select|Wrap|Line Numbers
  1. Private Sub ListBoxName_Click()
  2.     TextBoxName = ListBoxName.Column(9)
  3. End Sub
I always prefer the VB solution because the flexibility.
Jun 11 '11 #5

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

Similar topics

9
3251
by: Frances | last post by:
Hi All, * PREMISE * I'm creating an Access form with 150 items subdivided into 20 categories. Multiple categories (and items) can be selected so my user wants checkboxes. All of the options need to be visible at the same time so no dropdowns (combo boxes) and no scrolling lists (list boxes). I will use tabbed sheets with logically...
2
11672
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. tCetecM1CUST (SQL Table that contains the Customer Information) tAccountingDetail (SQL Table that contains the information in the form) frmAccountingEntry...
3
3401
by: Mary | last post by:
I have an online form that users fill out and upon submission the data goes to an MS access database on our server. One of the fields asks for the date a student needs to take an exam. The students know they should only use the online form if they are scheduling at least 2 weekdays ahead of time, however, the form doesn't currently have a...
3
1511
by: tony bergstrom | last post by:
Ok, so I have a Form. It is a continuous form. In the header one selects what person to view data for. Once the person is selected, the travel information that has been budgeted for the year associated with that person appears below (this is a 3 table, many to many: people travel to locations). The final line of the continuous form is...
1
2348
by: Daniel | last post by:
Hi, i need som help!!! I have a form wich a user type some new data in! And when he/she hits the 'Add' button... i want the data on the form to fly straight into an existing table!! Please send some example....
6
2520
by: Jack | last post by:
Hi, I have an Access application which need to be converted to asp-sql server application. This Access application uses a single form. This form has got a SS number with names and age. The form has two subforms. One of the subform uses a physical test score which is basically four different fields while the other subform is one that has a...
1
1449
by: lproslim | last post by:
I am new to programming and ACCESS so bare with me . I have an access form that i have created with the table wizard. M y question is how or what do i o to set the the focus or maybe wrong choice of words to when a person clicks my combo box list and choose a an item(which are my tables), i want access to save the information in the textbox on...
10
2788
by: Magnus Warker | last post by:
Hi group! I know that HTML output is not as predictable as sometimes desired, but let me ask a question. The following HTML code produces a rectangle that covers the entire client area of a web browser (table with width/height='100%'). Within this rectangle there is another rectangle, and it is desired that this inner rectangle covers...
1
10468
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am trying to export to Excel using a command in an Access Form. RowID strFY AccountID CostElementWBS 1 2008 1 ...
2
6187
by: buddyr | last post by:
Hello, I saw an example of microsoft access form based on table. the form had combo box to select employee and and then labels and textboxes below. The form had a pie chart that changed to correspond to each record. I cannot create a pie chart that changes with each record and displays on the form.. Do you know how to create a pie chart on a...
0
7178
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
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...
1
7128
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...
0
4759
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...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
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
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
473
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.