473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 2359
Mariostg
332 100+
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,556 Expert Mod 16PB
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!cboContract.Column(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 100+
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
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...
13
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
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
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 ". ...
4
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...
0
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...
6
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...
4
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...
10
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...
11
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.