Insert Automatic Value In A Table

Oct 20, 2006

HI,
Is it possible to save data in a table, just doing a check on the value of a combobox?

I need to insert a Num_CC value that I got from a table called TB_ANAGRAIFCA, in the table called TB_ALLEGATI. But the value of Num_CC depends on the value selected in a combo box. So I have to save the Num_CC related to the Provider selected in the combobox namade Nome_Provider.


Any suggestion?

I tried to draw in the form interested a textbox invisible, but I don't know how to retrieve the data.
Please, HElp me ....

Thanks,
Antonio.

View Replies


ADVERTISEMENT

Tables :: Use Insert Into Command To Insert Filepath Into Table That Adds Blank Label

Aug 28, 2014

I am at work, and I have acquired a database that prints labels. They now want the database to be coded so that after certain labels are printed the database will print a blank label. I have the code figured out as a Do While statement in order to print the blank label. The problem I am having is that I am trying to use the Insert Into command to insert the filepath into the table that adds the blank label.

|DoCmd.RunSQL "INSERT INTO Rod_tmakLabels ( Print, [Order] ) SELECT Yes AS Expr1, 'Rods Labels' AS Expr2"|

If I run the above command, it just adds the text "Rods Labels" at the end of the table. Is there anyway with the INSERT INTO command that I can insert the new label between the 2nd and 3rd row and add another row? Or is the command designed only to add a new row to the end? I haven't had any luck searching for this yet.

View 1 Replies View Related

Automatic Calculation In Table

Jun 27, 2006

I am new to Access. Is there a way to do a automatic calculation in a table field?

eg fieldA divided by fieldB and have the result show up in fieldC

Thanks

View 7 Replies View Related

Automatic Transfer Of Data From One Table To Another?

May 6, 2007

PLEASE ANSWER ASAP!!!

I was wondering if there was a way to automatically transfer data from one table into another. Specifically, if I have two tables, one called Students and one Alumni, is there a way I can click a button or something to transfer a student's data file from the Students' table into the Alumni table? Without having to delete the student's file from Student and retyping it all into Alumni?

Also, is there a way to, for instance, type individual monetary amounts into a single entry in a table and have the total automatically summed? Like, if I have a table for Donors, and every time one person makes a donation, add that one donation to their personal information and have another field that gives the total amount of all of their donations?

Thanks!

View 9 Replies View Related

Automatic Record Creation In Table

Feb 18, 2014

I have two tables; Customers and contracts.

I would like access to automatically create a record in the contracts table when I change the status in one of the Customer Fields from prospective to Customer.

The two tables are linked using the Customer ID field.

Is this possible?

View 1 Replies View Related

General :: Adding Automatic Timestamp Field To The Table For New Records?

Jul 2, 2015

I am looking to add a field to my table with a timestamp for each new entry.

I am working with a split database. All of the records are inputted by forms (in the back end by other users). I want to be able to see the exact time that a record was added, but without having to add this field to the actual form. I just want to be able to have a field in the table that shows me when the user submitted an entry. Is there a way to add an automatic timestamp field to the table?

View 1 Replies View Related

Modules & VBA :: Automatic Database Table / Fields / Records Count

Apr 9, 2014

the project I have comprises four seperate databases all linked but kept apart for logic and data reasons. I must have rapidly approaching 300k records across all of them. As a result I am trying to extract on a regular basis (monthly) the dimensions of each database. Specifically, I want to be able to produce for each database;The number of tables (I have two types data and reference, it would be nice to be able to split the result).The number of fields per table.The number of records per tableI am not really interested at this point about other database objects, such as queries or reports.

View 11 Replies View Related

Automatic Name Of Field When A Range Or Column Is Imported From Excel Into A Table In Access

Oct 9, 2014

When I import a column from Excel into a new table in Access using the Docmd.transferspreadsheet function, Access automatically assigns a field name of "F1"; and if I try to import a range of columns (Eg A1:B10), then Access saves them into a table with 2 columns with field names "F1" and "F2". The table is created as part of the Docmd function, and so I don't have control over the field names.

Is this going to always be the case? Can I depend on Access to always use this naming convention? Because I am about to start writing more code that will depend on these field names.

View 6 Replies View Related

Queries :: Access 2007 - Insert Into Table Where Source Is Another Table And Form

Feb 3, 2015

If you want to use a "DoCmd.RunSQL "INSERT INTO" command to insert data in a table and the data to insert comes from a table and a form, could this be done in one pass?

So...writing a record wit 4 values from table1 together with a additional value from a textbox in table2 as 5 values.

View 5 Replies View Related

Modules & VBA :: Parent Table Revision History - Insert Multiple Records Into Child Table

Sep 8, 2014

I have a parent table (tblLabels) and a child table (tblRevision) where the revision history for the parent table is kept.

The parent table is populated via an excel import and may have several records imported at once. Instead of having the user manually enter a new record note in the child table for each record imported into the parent table, I've created a form that collects the necessary data (date, person who added the record, person who authorized the record, and notes) and then creates a revision history for each new record.

This is what I have so far:

Code:

Private Sub cmdAddNotes_Click()
Dim strSQL As String
Dim RevisionDate As String
Dim RevisionRevisedBy As String
Dim RevisionDesc As String

[Code] ....

When I run the code nothing happens. No error, no new records create, etc. My suspicion is that I may need to use an INSERT INTO query instead of an UPDATE query, but I'm not sure how to go about matching up the foreign keys if that's the case.

View 14 Replies View Related

Insert Records Into Table Based On The Select Criteria From The First Table.

Mar 22, 2005

Hi

I have a small database with 4 tables that I am using for the current problem.
The tables are call, parents, mailman, orders.
Call and parents are related by the call ID (a primary key in the Call table.).
Mailman and orders are related by a Unique Id (a primary key in the mailman table.).

Forms involved are frmmain and frmsub.

Frmmain contains the call table information in the main form and parents information in the subform.

When a user enters a call with call ID and enters the operator name and parents information in the sub form,
When a user clicks the OK button on the main form, necessary changes should take place
if they enter the case type in the sub form part of parent information as ‘missing information’ or ‘missing link’ then the parent information with fields first name, lastname, case type, operator information should be inserted into mailman table in appropriate fields.

Simultaneously a record should be inserted into orders( after the record is first inserted into mailman, since both tables are linked with unique id) with the following information.
Orderid being autonumber.
Uniqueid from the mailman table.
Orderdate system date.
Ordertype should be “Mailman”

View 4 Replies View Related

How To Copy A Column From One Table And Insert It Into Another Table In The Same Db

Feb 3, 2006

How to copy a column from one table and insert it into another table in the same database

Hi, All,

I have two tables (old and new) sitting in the same database. The new table is the result of 'data cleansing' done by an external company. In the process (export and import via excel) two memo type colums in the table were truncated in excel.

To make the new table usable, I must therefore now copy/insert the two memo columns from the old table into the new table.

Both tables are already Access tables and sit in the same database. Both tables, of course, have the same number of rows.

I tried to high-light one column in the old table, clicked copy, then high-lighted a blank column in the target table, then clicked Paste, but got error msg: "This text is too long for this field. Try copying a shorter text", as if I had wanted to copy the whole column into one cell rather than one column into another column of equal length.

What is the best way to proceed?

Thanks for your help.

Adrian

View 4 Replies View Related

Insert X Records In Table Based On Value From Another Table

Jan 9, 2007

Newbie question: I have a database where we track dispatched with two tables, one called Slots, the other called Dispatches.
In the slots table there are 2 fields, one called Week (which hold the Monday date for each week in the year), the other called Available (in this field we want to manually enter a number that will tell the system how many dispatches we can do that week). We want to automatically take the number from the Slots.Available and enter X number of blank records in the Dispatch table with the monday date.
How can this be done?
Then we will create a form that can be filled in with the balance of the information.
Thanks

View 3 Replies View Related

Insert Into Table

May 11, 2006

On the creation of a reconrd in the main table I'm trying to auto fill a sub table with standard information for the user. This is what I'm using to insert into the sub table:

db.Execute "INSERT INTO tblHistologySlides (HistID, HistSlide, HistEntBy) VALUES (" & Me.HistAutoNo & ", " & Me.Text58 & ", " & Me.HistEntBy & ")"

It's stepping through the code without problem but the data isn't going into the table.

Any ideas where I'm going wrong?

Thanks

D

View 3 Replies View Related

How To Get Name From Table And Insert It As ID To Another

Mar 8, 2014

I have an access database that contain 2 tables and 1 form :

table1 named customers (custid-custname)
table2 named sales(salesid-custid)
form named form1 contain (salesid-custid)
*note:in form1 custid is combobox

What i need is when i select an customer from combobox the column custid in sales table get custid not custname

I use this sql statement to get combobox items from customers table

Code:
SELECT Cust.[Cust-Name] FROM Cust;

View 1 Replies View Related

May I Insert A Record Into The Top Of A Table?

Nov 4, 2004

May I insert a record into the top of a table?
Please help me! Thanks very much!
My email: jokelogpop@yahoo.ca

View 9 Replies View Related

Insert Dates Into Table

Mar 13, 2006

Hello,
I have a table with 2 fields - WeekID(autonumber) and WDATE(date/time). What I want to be able to do is to enter a value for the first date and then have the next 25 entries automatically entered. Each entry is to be 1 week greater than the previous entry. Ultimately giving me a list of dates, numbered 1-26, incremented weekly.
I assume the DATEADD function is to be used but i cannot determine how.
Any help / pointers is greatly appreciated.
Thanks

View 2 Replies View Related

Insert Values From Same Table

Jan 18, 2007

Hi
I am creating an employee db, with fields including employeeID, surname, firstname, partnerSurname, partnerFirstname, partnerID. As some partners work at the company, I want the partnerID to list (thorugh a value box) employeeID's that match surname to a partnerSurname and firstname to partnerFirstname.
Is this possible? Any help greatly appreciated.
Thanks in advance.

View 1 Replies View Related

How Do I Insert Data From One Table To Another?

Mar 7, 2007

I want to set my insert such that

Insert into tableA (x,y,z) = (SELECT x,y,z FROM tableB)
WHERE NOT EXISTS (select x,y FROM tableA,tableB WHERE tableA.x = tableB.x AND tableA.y = tableB.y)

Basically I want to insert data in tableA from tableB if it does not exist in tableA yet.

Access says I'm not writing an updateable query.

View 1 Replies View Related

Insert Records From One Table To Another

Apr 10, 2007

hi, i want to convert some below mentioned format into msaccess tables.

the exact scenario is that i have some text files from old applicaiton (pascal based) which is no longer working due to hardware compatibility problem...

which has generated some text files under below mentioned format...

[CLIENT]
L1_CUSTOMER_REFERENCE=AbreyCatherine
L1_TITLE=Ms
L1_SURNAME=Abrey
L1_FORENAME=Catherine
L1_DOB=1 Jul 1957
L2_DOB=9 Jul 1954
L1_ADD1=165 Downhills Way
L1_ADD2=Tottenham
L1_ADD3=London
L1_PCODE=N17 6AH
Q_L1_SEX=F
L1_CLCODE=CA1
L1_MSTATUS=M
L1_RELIGION=Christ.
L1_HASPARTNER=Y
L1_PARTNERNAME=Gian Paolo Caddeo
L1_PHONEH=0181 889 3870
L1_SALUTATION=Catherine
L1_OCC=Management Consultant
L1_EMP_STAT=S
L1_HEALTH=G
L1_SMOKE=Y
L1_NATIONALITY=British
L1_NRA=60
L2_OCC=Heating Engineer
L2_EMP_STAT=S
L2_HEALTH=G
L2_SMOKE=N
L2_NATIONALITY=Italian
L2_NRA=65
FactFindDate=30 Oct 98
TermsOfBusDate=30 Oct 98
LastVisitDate=18 Oct 95
LastLetterDate=14 Dec 99
Consultant=KP
AdminRef=AT
BestCallTime=Evenings
ClientType=UKCL
L1_WillDate=1993
L2_WillDate=1993
MailAllowed=-1
LastMailDone=0
L1_NINumber=YZ070258B
SeparateTax=
ContactFrequency=26
ManualSelect=
ClientLastUpdated=29 Jun100
[CLIENT]

each and every record starts from [CLIENT] and First part is the field and the part " = " is the value for the respective field.

now, i need help in converting that information into msaccess tables and its respective values...

like ...1) first part will become the field of table and
2) 2nd part after " = " will be the value for the respective field of the respective table.

i hope that this has given clear picture. where i want help from an expert...so, kindly help me. That will be great indeed to me.. thanking yours...om

View 9 Replies View Related

Insert Into Existing Table

Feb 20, 2008

I have a table which contains the following fields:
WORKER,SUB SYS,JAN-08,FEB-08,MAR-08
I want to insert into this table each month the data from the second table for that month
can someone tell me how to do this...each time I try the secnd table data TOTAL strarts a new row below the ones that are already there...hard to explain. I tried this and it didn't work:

INSERT INTO [ORACLE SORA ALERTS BY WORKER] ( [JAN-08] )
SELECT A.TOTAL
FROM A INNER JOIN [ORACLE SORA ALERTS BY WORKER] ON (A.SYS = [ORACLE SORA ALERTS BY WORKER].[SUB SYS]) AND (A.WORKER = [ORACLE SORA ALERTS BY WORKER].WORKER);

WORKER SUB SYS JAN-08 FEB-08 MAR-08
0000A CRT
0000A ENF
0000A FIN
0000A RAP
000AT CRT
000AT ENF
000AT FIN
000AT RAP
000AX CRT
000AX ENF
000AX FIN
000AX RAP
I have a second table which contains the following fields:
WORKER,SYS,TOTAL

WORKER SYS TOTAL
0000A CRT 1
0000A FIN 21
000AX CRT 1
000AX ENF 2
000AX FIN 11

What I want is to move the numbers in the TOTAL COLUMN INTO THE MONTH/YEAR COLUMS IN THE FIRST TABLE. Would look something like this:

WORKER SUB SYS JAN-08 FEB-08 MAR-08
0000A CRT 1
0000A ENF
0000A FIN 21
0000A RAP
000AX CRT 1
000AX ENF 2
000AX FIN 11
000AX RAP

View 1 Replies View Related

Insert Into Existing Table

Feb 23, 2008

When I run this query I want the data inserted into an existing table in the correct place. It is inserting the data in the correct column but not the correct rows. Please see attached screenshot. Can you please show me what I'm doing wrong.

INSERT INTO UNDISTRIBUTED ( Jun2003 )
SELECT Sum(CCur(a.AMT_TO_DISTRIBUTE)) AS AMOUNT
FROM NOLDBA_RECEIPT AS a, NOLDBA_INT_CASE_STATUS AS b
WHERE (((Trim([a].[id_case])) Is Not Null) AND ((a.ID_CASE)=[b].[case_id]) AND ((a.CD_STATUS_RECEIPT)='H') AND ((a.DT_END_VALIDITY)=#12/31/9999#) AND ((Exists (select 1 from NOLDBA_RECEIPT k where a.dt_batch=k.dt_batch and a.no_batch=k.no_batch and a.cd_source_batch=k.cd_source_batch and a.seq_receipt=k.seq_receipt and k.ind_backout ='Y' and k.dt_end_validity =#12/31/9999#))=False)) OR (((Trim([a].[id_case])) Is Null) AND ((a.CD_STATUS_RECEIPT)='H') AND ((a.DT_END_VALIDITY)=#12/31/9999#) AND ((Exists (select 1 from NOLDBA_RECEIPT k where a.dt_batch=k.dt_batch and a.no_batch=k.no_batch and a.cd_source_batch=k.cd_source_batch and a.seq_receipt=k.seq_receipt and k.ind_backout ='Y' and k.dt_end_validity =#12/31/9999#))=False) AND ((b.CASE_ID)=(select min (y.case_id) from NOLDBA_INT_CASE_STATUS Y, NOLDBA_INT_CASE_MEMBER Z WHERE A.ID_PAYOR=Z.MEMBER_ID AND Z.RELATION_CODE IN ('A','P') AND Z.CASE_ID=Y.CASE_ID)))
GROUP BY b.IV_D_DO_CODE
ORDER BY b.IV_D_DO_CODE;

View 4 Replies View Related

Insert The Value From A Txtbox Into A Table

Sep 15, 2005

Hi there

Can someone give me a basic example.

I have a form that contains a textbox and a listbox. The listboxs rowsource is tblSPNZ.
The table has 2 fields 1 is and autonumber and the other is where I want the results to go.

How do I make a command button populate the table? Avoiding putting any results into the autonumber field?


Thank you for your help.

View 11 Replies View Related

Create Table And Insert Into...

Jan 24, 2005

Hi
I've got two queries:
1.
create table oversikt
(
ansatt_nr number not null,
first_name text Null)

And
2.
INSERT INTO oversikt ( ansatt_nr, first_name )
VALUES (777, 'Andrew');

Is it possible to combine these in one query?

eroness

View 2 Replies View Related

VBA - Insert A Record From One Table To Other?

Aug 15, 2014

In my VBA code, i am trying to move some table records from table1 to table2. Both table1 and table2 has exact structures.

In the INSERT statement for table2, what is the easy way to insert a record from table1? I am trying to avoid having to specify each field name in the INSERT statement. Because, i have 100 fields in table.

Is there a way to INSERT a particular record from table1 to table2 without having to specify field names in the INSERT statement like in below example?

INSERT INTO Employees " _
& "(FirstName,LastName, Title) VALUES " _
& "('Harry', 'Washington', 'Trainee');"

View 1 Replies View Related

Insert Table Records Into Another Table

Mar 5, 2008

I have this query below:

INSERT INTO TEST_DOC
SELECT *
FROM MPI_ADDSS_IFF;

I currently have 10 tables in my database (All with the same colunm names and formats) however i want to click a button that will put all the tables into TEST_DOC, instead of doing it one by one. To do this this i would like some code either in SQL or VBA that will do this.

Any ideas or help?

Kind Regards
Hewstone999

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved