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

Home Posts Topics Members FAQ

Editing contents of a table by showing word example instead of letter in combo box b

1 New Member
Hi - I'm quite new to VBA, using Access 2007. Apologies if this is a stupid question !!

I have created a form for users to view the details from a table, so they can edit fields in that table - e.g. where the optical mark reader has misread a field on the paperwork. What would be easiest for the user would be if the DLookup gave the explanation of the field rather than just the code letter, but I need the table to always have just the letter stored.

Is this possible?

For example, the table has letters a-n representing different answers for the date the property was built.

I use a combo box with two columns to show the letter and the explanation e.g.: a;before 1900;b;1900-1920 etc.

If I make the 1st column to be width zero, it only shows the explanation in the drop down menu, but the DLookup query doesn't seem to work as the field is blank. The letter only shows if I have column widths for both letter and explanation in the combo box.

I also need any change to be stored as the associated letter in the table.

I have been using a Value list as the row source. There are 20 fields which could be edited.

Any advice gratefully received !! Thank you.
Oct 16 '14 #1
2 895
jforbes
1,107 Recognized Expert Top Contributor
I tried to find and Article or Post here on Bytes that explains the Basics of ComboBoxes, but I failed to find one.

So... Comboboxes can be a little confusing until you get used to them.

Probably the first thing that you need to wrap your head around is RowSource and ControlSource:
  • RowSource - Works in conjunction with RowSourceType to provide the ComboBox's drop down list; the values the User can select from.
  • ControlSource - Is the Field on the Forms RecordSource that the ComboBox displays and Edits. This is the Field that is saved in a Table. Filling this in Binds the ComboBox Control to the Field. Without a value here, it is considered an Unbound Control.
Once you've got down that there are two different places the ComboBox gets information from and one of those places is where it stores the selected value, you can turn your attention to what is displayed in the Drop Down List of the ComboBox. The next few fields to get acquainted with are ColumnCount, BoundColumn, ColumnWidths:
  • ColumnCount - Lets the ComboBox know how many columns to display to the User. The ComboBox's RowSource may return five columns from a select query, but if the value here is two, only two columns will be displayed to the User.
  • ColumnWidths - is a list of widths for the columns in the RowSource. Typically, there are a number of entries equal to the ColumnCount, so the ComboBox has a Width for each Column it is to display to the User. Additionally, if the width for a column is Zero, the column will be hidden from the User.
  • BoundColumn - This is the Property that links RowSource and ControlSource together. It tells the ComboBox which column in the RowSource to stuff into the ControlSource when the User selects a value.

I think once you get this down, you will be able to get Access to do what you want.
Oct 16 '14 #2
twinnyfo
3,653 Recognized Expert Moderator Specialist
Kate,

Also, in addition to J's sound advice about Combo Boxes, it appears that your DB may not be properly normalized (which would also help to alleviate many of your problems. Please refer to the Database Normalization thread that we send folks to, to review some basic principles that may assist you with this.
Oct 17 '14 #3

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

Similar topics

1
3714
by: Daniel Hill | last post by:
OK, I have very, VERY basic background knowledge of VB6 and have now upgraded to VB.NET and now I'm struggling to bring up the forms I want. What I am looking to do is to have a click a command...
2
2461
by: elziko | last post by:
I'm trying to create a new table in word from a DataTable (sourceTable): objDoc.tables.Add(Range:=objDoc.Range, NumRows:=sourceTable.Rows.Count, NumColumns:=sourceTable.Columns.Count,...
2
3488
by: Reny | last post by:
Hi, I made a crystal report using vs.net 2003 and it is showing junk character instead of arabic and my db is oracle 8i.Can any one tell me why ?
1
6803
by: christianlott1 | last post by:
I want to copy an Access pivot table into word with vba. I'm guessing I'd need to Select All, copy to the clipboard, and paste special into word at a bookmark. I know how to address the...
0
1312
by: pshrinivassharma | last post by:
Hi I am writing a application where i need to read a word document and then i need to tag the important points and then i need to save those tagged data in a database . Then i need to use the...
0
781
by: cholletivinod | last post by:
Hi friends , am creating one application in dat i want to replace particular text(<<ABC>>) with a table in word document am using below code but am getting text if i open the...
3
1421
by: Steve | last post by:
How can I get a list of the fields in an Access table into Word? I am working on a very misdesigned database where one table has over 100 fields and several others have over 50 fields. I am writing...
4
5541
by: zcabeli | last post by:
Hi all, i'm currently struggling to perform the above mentioned replacement. i already know how to catch the first letter in each word and determined if it's regular or capital. however, i...
4
1380
by: Ploepsie | last post by:
Hey, first of all I want to state that I am very new to using Access and therefor the question might be relevantly easy to solve but I have spent hours thus far to find the answer online and in...
0
7157
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
7535
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
7098
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
7521
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
5682
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
5084
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
4745
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...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
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.