473,387 Members | 1,388 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,387 software developers and data experts.

Update Textbox with ComboBox Selection lookup value in table

gcoaster
117 100+
Hello!

I have a dilemma


I have a form that is bound to a table = tblCALLDETAILS
I have a field in the table that is on the the form called = email, that is a textbox
txtClientEmail

There is a combobox that has column1 clientFK and column2 FullName

I want to populate the email textbox with email address from tblCLIENTS
and INSERT it. and when CALL is updated, the column is updated and a new record is NOT inserted.

I have tried DLookup , Update, Insert and ... maybe I am not smart enough for access!!!

this code actually works but inserts a NEW RECORD when combobox is updated.

Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute "INSERT INTO tblCALLS (clientEmail) Values ('" & Me.cboFullName & "' )"

Any suggestions?
Nov 29 '07 #1
4 9373
Rabbit
12,516 Expert Mod 8TB
Hello!

I have a dilemma


I have a form that is bound to a table = tblCALLDETAILS
I have a field in the table that is on the the form called = email, that is a textbox
txtClientEmail

There is a combobox that has column1 clientFK and column2 FullName

I want to populate the email textbox with email address from tblCLIENTS
and INSERT it. and when CALL is updated, the column is updated and a new record is NOT inserted.

I have tried DLookup , Update, Insert and ... maybe I am not smart enough for access!!!

this code actually works but inserts a NEW RECORD when combobox is updated.

Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute "INSERT INTO tblCALLS (clientEmail) Values ('" & Me.cboFullName & "' )"

Any suggestions?
1) I want to populate the email textbox with email address from tblCLIENTS
and INSERT it.

When and how often do you want to do this?

2) and when CALL is updated, the column is updated and a new record is NOT inserted.

I have no idea what CALL is, you have not told us.
Dec 10 '07 #2
gcoaster
117 100+
Hello Rabbit!

here was the solution to my problem

This code is getting email address from combobox in column 3 and populating
field on form named clientEmail.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboFullName_AfterUpdate()
  2. Me.clientEmail = Me.cboFullName.Column(2)
  3. End Sub
  4.  
I have learned you can bring in more then 2 values using wizard for combobox on a main form and then use those values from it to populate textboxes on forms etc one of the many tricks i have learned on here.

thank you very much and may the Lord bless you this Christmas
gcoaster
Dec 13 '07 #3
Rabbit
12,516 Expert Mod 8TB
Good luck.
Dec 13 '07 #4
Owgur
3
Thanks for that.

Wow I looked and looked. And when you posted that I said to myself DUH....

Thanks
Mar 20 '08 #5

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

Similar topics

30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
3
by: dbuchanan | last post by:
Hello, (Windows forms - SQL Server) I fill my datagrid with a stored procedure that includes relationships to lookup tables so that users can see the values of the combobox selections rather...
0
by: Bob | last post by:
Its often necessary to allow the user to remove a selection from a combox. In my case, most are bound to lookup tables. I suppose I could, in each lookup table create an empty record and have in...
6
by: eclypz | last post by:
Whe i use a combobox, and i want it to update it's value i use the code ME.cbxname.Requery How can i do that to update the value of a textbox? i have already try to use the same expression,...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
5
by: njb35 | last post by:
Hi all I'm beginning my foray from VBA into VB 2005 Express, and enjoying some of the efficiencies it provides! I'm stuck with some dataset handling however that I _think_ can be automated but...
14
by: Mark | last post by:
I have a table with a field that uses a combobox to populate values. The Lookup tab within table design mode is the following: Display Control Combo Box Row Source Type ...
9
by: Greg (codepug | last post by:
I have a combobox with the RowSourceType set to Table/Query and the RowSource is an SQL query that references a separate lookup table that contains the data that can be selected in the combobox....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...

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.