473,799 Members | 3,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

INSERT Value into table after update. single value INSERT

gcoaster
117 New Member
Hello Gurus,
I am stuck! this will be easy I am sure for you.

I have a Text Box where I type In a name.
I am trying to get that value to insert into another table when I TAB to the next field.

Most of the INSERT code examples I find deal with multiple VALUES.
could you point me in the right direction?


thank you!
Nov 28 '07 #1
7 14463
HiTechCoach
30 New Member
In the After update event, I would use an Append query to Insert the the record.

Something like:

Expand|Select|Wrap|Line Numbers
  1. CurrentDB.Execute "Insert into tblYourTable (Field1) Values('" & Me.TextBoxControl & "')"
  2.  


Hello Gurus,
I am stuck! this will be easy I am sure for you.

I have a Text Box where I type In a name.
I am trying to get that value to insert into another table when I TAB to the next field.

Most of the INSERT code examples I find deal with multiple VALUES.
could you point me in the right direction?


thank you!
Nov 28 '07 #2
gcoaster
117 New Member
oh man.. You guys ROCK! !
IT WORKS!! sorry, I spent 3 hours trying to figure it out and to see it work kinda was exciting..

Expand|Select|Wrap|Line Numbers
  1. Private Sub txtBoxName_AfterUpdate()
  2. CurrentDb.Execute "Insert into tblNames (firstName) Values('" & Me.txtBoxName& "')"
  3. End Sub
Nov 28 '07 #3
gcoaster
117 New Member
ok.

INSERT inserts a new value and RECORD when txtBoxName is updated or if modified.

How doI write code to update if there is already a value?

thank you
Nov 28 '07 #4
HiTechCoach
30 New Member
How will you know wich record to update?

You will need to someway identify the record by something unique like the Primary key.

I normally do not do this. I would just insert an additional transactional record.

If we know what you are trying to do, we will be able to help you find the best solution.

What are you trying to accomplish?
Nov 28 '07 #5
gcoaster
117 New Member
I have a field in a subform that i want to update with what is entered in the main form.

table 1 is bound to fmMAIN and Table2 is bound to fmMAINsub

when I enter domain text into domain field in Table1 I need code that udpates in the afterUpdate and inserts into the domainName column in Table2 or udpdates if text is changd. and maybe in another field in a table in the database

TABLE1
webID
clientFK
domain

TABLE2
webDetails
webFK
clientFK
domainName
Nov 28 '07 #6
MMcCarthy
14,534 Recognized Expert Moderator MVP
Sorry to butt in, but this sounds like you are duplicating information for domain in both tables. If not then I don't understand what you are doing.
Dec 11 '07 #7
gcoaster
117 New Member
Hello mmccarthy!!
You can butt in anytime you like princess!

Mary, I have just learned vba in the last 2 months and had a time figuring it out.
I am still having a hard time wording things properly. like for instance, 2 months ago questions and searches about
"cascade combo boxes" where worded
"filtering results from dropdown"

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 #8

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

Similar topics

6
2239
by: a-ok | last post by:
Hi, My client has a product database od around 20000 items. And it is updated every few days when he gets a catalog from the supplier. It's supposed to work like this: if there already is a product in the database with that ID (primary key), just UPDATE the price, and if there is no product with that ID it should do an INSERT for that item. Now I've tried it in several ways and I can't seem to get it to execute
4
22200
by: DTB | last post by:
I am having trouble creating an INSTEAD OF trigger in SQL Server to replicate a BEFORE UPDATE trigger from ORACLE. Here is a sample of the ORACLE BEFORE UPDATE trigger: CREATE TRIGGER myTRIGGER ON MYTABLE begin :new.DT := SYSDATE; if :new.NM is NULL then :new.NM := USER; end if; end myTRIGGER;
11
4859
by: Randell D. | last post by:
Folks, I have a table of addresses and a seperate table with contact names - All addresses tie to one or more names - I would like to keep track of the number of names 'belonging' to an address and have thus included a column in my address table called num_of_contacts. Everytime I add a new contact, I would like to increment the num_of_contacts column in the address table. Is this possible?
1
15428
by: shottarum | last post by:
I currently have 2 tables as follows: CREATE TABLE . ( mhan8 int, mhac02 varchar(5), mhmot varchar(5), mhupmj int )
14
4302
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to salvage the records from the many table and without going into detail, one of the reasons I can't do the opposite as there are records in the ONE table that I need to keep even if they don't have any child records in the MANY table. Below I created...
16
3877
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the table, or perhaps bytes, being updated where the engine just decides, screw it, i'll just make a new one. surfed this group and google, but couldn't find anything. the context: we have some java folk who like to parametize/
5
3345
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by definition? Thanks Klemens
20
18390
by: Mark Harrison | last post by:
So I have some data that I want to put into a table. If the row already exists (as defined by the primary key), I would like to update the row. Otherwise, I would like to insert the row. I've been doing something like delete from foo where name = 'xx'; insert into foo values('xx',1,2,...);
8
3522
by: nano2k | last post by:
Hi Shortly, I keep invoices in a table. Occasionally, someone will fire the execution of a stored procedure (SP) that performs several UPDATEs against (potentially) all invoices OLDER than a date that is supplied to the SP as a parameter. The SP is usually a lengthy process (it takes at least 30 mins). The problem is that SQL server 2000 Dev Edition doesn't allow me to insert new invoices that are "younger", while the SP is executing....
8
6503
by: SaltyBoat | last post by:
Needing to import and parse data from a large PDF file into an Access 2002 table: I start by converted the PDF file to a html file. Then I read this html text file, line by line, into a table using a code loop and an INSERT INTO query. About 800,000 records of raw text. Later, I can then loop through and parse these 800,000 strings into usable data using more code. The problem I have is that the conversion of the text file, using a...
0
9687
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
9541
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10251
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
10228
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,...
1
7565
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4141
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
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.