473,587 Members | 2,588 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 903
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
3718
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 button bring up a form, and to have which form is brought up determined by which item is selected in the accompanying combo box. I've gathered...
2
2468
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, DefaultTableBehavior:=1, AutoFitBehavior:=0) Where objDoc is a Word.Document. However I'm always given the error message "The range cannot be deleted". But...
2
3502
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
6816
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 bookmark, I just don't know how to select, copy and paste (actually, I will probably be able to find the paste special command for word) via vba. Right...
0
1313
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 data that i have saved in the databse to write to a word document in a perticular location in the word (i.e i using the bookmark property to book mark...
0
786
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 word document please help me System.Text.StringBuilder strDocContent = strDocContent.Replace("<<ABC>>", "<table><tr><td>a</td></tr></table>"); ...
3
1425
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 a report in Word and want to include the list of fields in certain tables. I am aware of the documenter; is there a way to get a documenter report...
4
5558
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 don't know how to replace this letter with it's corresponding capital letter. perhaps there is an option to change the ascii value of the a...
4
1388
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 Access 2000. Question uno (1) I have a table with around 60,000+ lines which gets updated every week. There has to be certain selections so I and...
0
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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
8206
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
8340
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
7967
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...
1
5713
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3840
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2353
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
0
1185
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.