473,785 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to populate a text field from the combo selection

I am trying to populate a text field from the combo selection.

I have the following update event in the combo box
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboContract_AfterUpdate()
  2. Me!txtDesc = Me!cboContract.Column(1)
  3. Me!txtPrinc = Me!cboContract.Column(2)
  4. Me.Refresh
  5. Me.tbl_TimeData.Form.cboAct.Requery
  6. End Sub
  7.  
No errors are encountered. The text field simply does not populate for the following line of code.
Expand|Select|Wrap|Line Numbers
  1. Me!txtPrinc = Me!cboContract.Column(2)
  2.  
.

Please note that ROW SOURCE query that is applicable to the combo box
Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_Contract.Contract, tbl_Contract.[Contract Description], tbl_Contract.Client_id FROM tbl_Client INNER JOIN tbl_Contract ON tbl_Client.ID=tbl_Contract.Client_id; 
  2.  
I find it strange that the [Client_id] field does not populate the [txtPrinc] field. Help appreciated
Oct 29 '10 #1
4 2383
Mariostg
332 Contributor
Did you check with Debug.Print Me!cboContract. Column(2)
to make sure there is indeed something in Column(2)
Oct 29 '10 #2
NeoPa
32,578 Recognized Expert Moderator MVP
My only guess (as it seems fine to me) is that the txtPrinc control may be misspelled.
Oct 29 '10 #3
Hi,

Do you mean Me!txtPrinc = Debug.PrintMe!c boContract.Colu mn(2)? If so, I receive a syntax error in VBA screen.

The [txtPrinc] field is spelled correctly.

Any other suggestions?
Oct 31 '10 #4
Mariostg
332 Contributor
No. Put it either after or before Me!txtPrinc = Me!cboContract. Column(2)
Debug.Print will output on the immediate window the value of your combo box. Ctrl+G will open the immediate window if you never used it.
Nov 1 '10 #5

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

Similar topics

4
10717
by: Rob | last post by:
Hey, I'm pretty new to MySQL and have a question. I've built a database locally and have inputed some information. I need to go back and update some records, specifically by taking long pieces of text and putting them into text fields. Cutting and pasting in the command prompt for windows isn't such a good idea. Is there a way to update an existing record by importing a text file into a text field?
13
6568
by: pkinville | last post by:
ok, this is gonna seem stupid, but it has been stumping me all afternoon. I have two fields on a HTML page. HTML looks like this... <html> <head> <title>New Page 3</title> </head> <body>
2
6604
by: G.Gerard | last post by:
Hello Does anyone know how to get an entire memo field to be displayed in a combo box drop down list? Example - if the memo field contains the following : This is a test to see if
8
18397
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". The values in the dropdown are loaded in the correct order, but the initial value is not the first row of the dropdown as I expected. The field "CategoryName" is not the primary key for the table -- the PK is
4
1767
by: Mark L. Breen | last post by:
Hello Guys and Galls, I use combos on my forms. The code to initialise the combos is as follows Dim dsPIDTypes As DataSet dsPIDTypes = PartDB.GetPIDTypes ' Returns a dataset object cboPIDType.DataSource = dsPIDTypes cboPIDType.DisplayMember = "tlkpPIDType.PT_Type"
0
1919
by: MightyAC | last post by:
I am having problems updating a text field with a very large string. If I build a string in code using a string variable and then update 1 row I have no problem. However, I want to run an update statement that hits many rows. When I run the stored proc that does this my string is being truncated near 3,800 characters. Here's an example of what I'm trying to do. BigString is a TEXT field. Update Table1 Set BigString = 'blah,...
6
4185
by: bammo | last post by:
MS Access 2003, Windows XP SP2, VBA I have a continuous form that allows edits and filters, but not deletions or additions. I filter the form based on combining selections the user makes in several combo boxes on the form. The filter is updated whenever the user changes his/her selection. My problem is when the user selects a filter option that is not present in the data. The filter works fine - no records are displayed; however, the...
4
13972
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt tbl_Input has three fields: OSE_Job, OSE_Name, OSE_Wt I have populated tbl_OSE_Info table. I need to create a form that will store the data in tbl_Input I have racked my brain so much trying to figure out how to auto populate a field based on a...
10
7421
by: dkyadav80 | last post by:
<html> /// here what shoud be java script for: ->when script run then not display all input text field only display selection field. ->when user select other value for institute only this field display not display degree text field ->when user select other value in the selection field for degree then text field display and wise versa //// <bodly> <table>
11
3736
tdw
by: tdw | last post by:
Hi all, I have tried a few different methods to accomplish this, but with no luck. I will post the code for the latest attempt at the end of this post. I work at a land surveying company. This database is for tracking survey orders. One of the fields is for entering the Subdivision that the parcel of land is in. That field on the New Orders entry form is called "SUB_NAME". On that form it is a combo box that uses a seperate table called...
0
9647
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5390
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.