Create New Record & Pass Autonumber To Separate Table

Mar 10, 2008

I have a form, frmSub, that contains the combo box comProducts. I also have two tables, Products and PurchaseDetail. Both tables have the field ProductID.

I want comProducts to create a new record in the Products table, using the input in a field called Product and then to use the value of ProductID to create a new record in the PurchaseDetail table. Ie, so the PurchaseDetail table has a record that links to another record in the Products table via the feild ProductID.

I hope I was semi-clear.

View Replies


ADVERTISEMENT

Reports :: Create Separate Report For Each Record

Apr 13, 2013

I have a query which displays only the records that match the criteria in the form given before. Now i want to create separate report for each of these records. How should i go about with it? I don't want a seperate form for this purpose, is there any way to do the same with a macro?

View 1 Replies View Related

Create A New Table Or Use Comma Separate Fields

Dec 27, 2007

All,

I have a quick question that could lead into a longer one.

First off, I am trying to associate tests with a course a student is enrolled in. Would it be better to add a column in the courses table and have a comma separated list of all tests associated with each course or would it be better to create a separate table that has a column for the course and another column for the associated test with that course?

If comma separated fields would be better, how would I handle that in forms? How does one parse that field?

Thanks!

View 6 Replies View Related

Queries :: Create Separate Columns From Same Field And Table

Apr 9, 2013

I have 1 table that I duplicated to make 3 tables total. I did this b/c I am trying to create separate columns from the same field and table. The field is Workorder. Each workorder list the workorder number followed by a dash and then code. I am wanting to put all of the workorders with the same code in it's own column.

I have 5 codes that i am searching for. The first column list the workorder and a code (123456789-AD). The second column (123456789-BC). I'm good to this point but my problem occurs next.

The third column i am trying to put 3 types of workorder and it's code in the same column. As follows, (123456789-CD, 123456789-TC, and 123456789-PTC. However, when I do this it takes the results from the 3rd column and applies it to the 3rd column but also the 1st and 2nd column. I tried a UNION query and unless I am doing it incorrectly it does not work.

View 3 Replies View Related

Tables :: Autonumber Field - Can't Create Record Because Data Will Be Duplicated

Feb 12, 2014

When I tried paste some data using front end to my database, Access showed error (can't create record because data would be duplicated). I thought it's impossible because it is autonumber field. So I checked it (manually). I did copy of my database and then for testing, I created record. I was shocked. Next record should has a value of "160" but Access gave "130" then showed an error "Can't create record because data will be duplicated". Of course after compact and repair everything is fine.

View 5 Replies View Related

How To Create A Table With An Autonumber Field

Dec 4, 2004

Hi,
I'm new to this forum and have a question:
I want to create a table with an Autonumber field using a SQL statement,
in Microsoft Access Database, something like this:
Cnn.execute "CREATE TABLE newtable (id Long, Name Char(100)) "
is there something to put in place of "long" to make the field autonumber?
I tried the word "autonumber", but did not work.


Many Thanx.
Hadi.

View 3 Replies View Related

Create Calculated Autonumber In A Table

Mar 17, 2008

I have a table where one field needs to be an autonumber, however, that autonumber needs to be calculated. This field is not based on any other information in the database, but there's a very complicated mathematical process behind it, which I'm figuring out...I just need to know once I get that code complete, how do I tie it into the table?

View 7 Replies View Related

How To Create A Access Table Having Autonumber Type With Sql?

May 20, 2005

hi,
field type of autonumber can not be created with sql,why?is autonumber a data type like int,text ect.?but int or text field can be created

View 3 Replies View Related

Make Table: Create AutoNumber Field

Feb 19, 2007

Hi All,

I am trying to create a make-table query, with a new AutoNumber field.

I know that if you are creating a new Text field you type FieldName: "" in Field and for a Number field you would type FieldName: [], but what do you type for an AutoNumber field?

View 2 Replies View Related

Update Separate Table When Record Is Edited

Aug 5, 2015

I have a form where a user can change the scheduled start date for a job. On a sub form on the same screen is a list of notes relating to that job.

Any notes added, automatically have todays date and are locked when the user clicks off.

When the scheduled start date is changed I need a note to be made. Either forced, then entered by the user or automatically.

I was thinking of making the scheduled start appear in a small form and the button to make it come up could add a new note on the click event (possibly in a message).

Or even better (probably harder) any time the value is changed in the form a new note is added.

Other options could be a pop up form to add one note on a change.

View 4 Replies View Related

Modules & VBA :: Write Separate CSV File From Each Record In A Table

Jun 22, 2015

I have the requirement to write EACH record from a table to its own CSV file with name of the file being combination of 2 fields

So let's say I have Table1 with 3 columns (Field1, Field2, Field3) with following content :

Field1 Field2 Field3
AA 1 ABC
AA 2 DEF
AA 3 GHI

I should get 3 files with names AA1.CSV, AA2.CSV and AA3.CSV and each file contains its respective row from the table.

I tried to do it with DAO Recordset, but I do not find a way to write only the current record from recordset while looping.

See below the code I was using, but issue is that code does succesfull creates the 3 CSV files as per above example, but in each file it writes ALL 3 ROWS instead only the respective ROW.

Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
Dim strFilename As String

[Code] ....

View 10 Replies View Related

General :: Simple Audit By Posting Whole Record To Separate Table?

Jul 30, 2014

I need a simple audit capability

I have a table (Called Master Active List)

I have an empty duplicate of it called History of Master Active List. (Identical fields, with the addition of a distinct ID (primary key)

I have a form where the master can be changed (Called customer details)

When any change is made I want to post the whole record to the history table

1 - Am I correct I no longer need a form based one,(office 2013) and can do one on the data table itself?

I want to capture everything, can this be done with a wildcard, or do I need to go line by line?

The master table has a ton of fields.

View 3 Replies View Related

Queries :: Appointment Database - Query Most Recent Entry For Each Record In Separate Table

Jun 20, 2013

I have a database that is used to allocate appointments to our staff. It has 2 tables, one that lists the clients we need to call in that day, and another that stores details of each contact attempt. I'd like to design a query that find all clients who we have not dealt with so we can easily get their details in a list. I know what the criteria for the query would be, but I'm stuck for how to actually execute it. Here are the details.

Table tClients stores the current clients - primary key is named "clientRef"
Table tContactEvents stores each contact attempt and the date/time is stored in a field named "dateTime".

When an entry has been dealt with successfully a yes/no field named "completed" will be set to "Yes".

There may be many attempts to contact a specific client on a given day, unsuccessful attempts will not have the completed flag set.

Once the completed flag is set that client will be ignored so no further entries will appear.

So I need a query that searches tContactEvents for the most recent match to each number in tClients.clientRef and checks if the completed flag is set. If the completed flag is false, or if the number has no match (i.e. no contact attempts made yet) then the clientRef should be displayed. I also need this to be restricted to the current date, as the same client could have rebooked their appointment to a different day.

View 10 Replies View Related

Reports :: Pass Listbox Parameters To Pull Multiple Separate Reports

Nov 23, 2013

I have a form that the user can add Work Order numbers to a text box and pass them to a listbox to collect 1 or more values. Each of which need a separate report with the labour hours for each Work Order.

I am having issues figuring out how to get it to pass them to a query or filter the reports.

I have tried many different examples and nothing seems to work.

View 4 Replies View Related

Tables :: Set Autonumber To Start From Last Record On The Table

Jun 10, 2015

I had a backup from a table that I saved to excel. Somehow we lost all the records from the table 10 minutes later. There where gaps in the id numbers due to some delete records in the past, and when I did try to put it back in the access table the records some how shift. is there a way of still using the ID nr that is an autonumber in the table and when I set the data back from excel and use the append when paste that they show up correctly? Maybe I can set the autonumber to start from the last record on the table?

View 14 Replies View Related

I Would Like To Create 4 Separate Databases From One Master

Dec 12, 2006

I have a large database of Purchase Orders
Orders can be placed by people in one of 4 departments

I would like to automatically make 4 separate databases (so each department can access their own) from the master

Is there a way to do this?

View 4 Replies View Related

Reports :: How To Take Two Separate Queries To Create 2 Line Graph

Nov 21, 2014

I want to be able to take two separate queries to create a 2 line graph. Also to be able to spice the graphs up some. The ones I have done, single line, even seems dull.

View 7 Replies View Related

Reports :: How To Create A Separate Ribbon And Attach It To Report

Aug 30, 2013

I've created a custom ribbon and it works great however I want to create a separate ribbon and attach it to the report. On this particular ribbon, I'd like the export to excel, export to word and print functions to appear ONLY for reports. Not all reports will need to be exported; it depends what the user does. I've created this XML and I'm not receiving any error message. It loads as expected but my group is blank/empty. Still confused.

View 2 Replies View Related

General :: 2 Fields From Separate Tables Needed To Create Calculated Field?

Aug 19, 2013

The interface being used is a main form with various tabs and a subform on each of these tabs.

There is one field ('max power density') in my database that is calculated using 'Max Rated Power' and 'Cylinder Capacity' however these are in different tables and subforms. The 'max power density' and 'max rated power' are in table and subform 1 but 'cylinder capacity' is in table and subform 2. Is it possible to keep them in separate tables/subforms and still calculate the field?

View 7 Replies View Related

Reports :: Writing VB Code To Loop Through A List Box And Create Separate PDFs

Aug 19, 2015

I have a sales report that I generate each week based on a query, which relies on the input from a combo box on a form. This works great - but I have select each salesperson, one at a time and run their reports separately.

I'd like to have some code that will run through each person on the list, generate their report, create the PDF, and email (or save) the file.From my initial research, it appears I will need to utilize a List Box (vs a combo box), so I can select multiple salespersons for the report.

I've found a few examples of code to use...but a little lost on how to implement. I create a new form with a list box that queries the property table for the list. I then added a button to execute the code, and attempted to add this (with my control and reports names substituted). Getting all sorts of errors -- so not sure I'm on the correct path.

'Posted by ADezii 5.23.2009 on bytes.com
'Modified by Gina Whipp 11.4.2009 to OutputTo Multiple Files
'Tested in Access 2003 with a Combo Box

Dim intCounter As Integer
Dim cboCode As ComboBox
Set cboCode = Me![ YourControl ]
'If Your Data Type is Numeric use this section

[code]...

View 14 Replies View Related

How Do I Create A Custom Autonumber

Mar 2, 2005

I currently have a few tables that use an autonumber as the primary key, however, I would like the autonumber to start with a series of letters if possible. For example: instead of it creating an ID of 1, then, 2, 3, 4, and so on, I would like it to append lets say "ABC" to the front of it; ABC1, ABC2, ABC3, etc.

AP

View 2 Replies View Related

Create AutoNumber Field

Dec 20, 2005

All,

I have trawled boards and sites, but cannot find the answer!

I have a make-table query, and I wish to create an AutoNumber field.

Now I know that if you put fieldname: "" , a Text field will be created and if enter fieldname: [] then a Binary field will be created.

Is there a code I can use to create an AutoNumber field?

Help appreciated!

Regards,

Jempie

View 5 Replies View Related

How To Create Autonumber With Dashes

May 8, 2013

I need to create a Autonumber field in a table with the following starting value 13-642-2000.

View 5 Replies View Related

? Create An 'autonumber' In A Query Result

Apr 18, 2006

Hi,

example:

SELECT tblFalls.Guest_Name, [Account_Number], Count(tblFalls.Account_Number) AS Falls
FROM tblFalls
GROUP BY [Account_Number], [Guest_Name];

Gives me:

Smith, Joe; M698, 1
Blinke, Frank; M686, 2
Neal, Bobbie; M648, 1


I need ot to give me,

1, Smith, Joe; M698, 1
2, Blinke, Frank; M686, 2
3, Neal, Bobbie; M648, 1

each time i run the query i need to list that guests, their number of falls and assign each unique guest a number starting with 1 on up...

How?
yes, yes, i know how to do it in a report, but I need right now to be able to do it in a query alone.. anyone?

I tried:
SELECT Sum(1+), Guest_Name, Account_Number, Count(Account_Number) AS [Falls]
FROM tblFalls
GROUP BY Account_Number, Guest_Name;

=p no luck.. though it looks neat.

I also tried writing a function

Public Function GetQryNum() As Integer
If IsNull(gQryNum) Or gQryNum < 1 Then
gQryNum = 1
GetQryNum = gQryNum
Else
gQryNum = gQryNum + gQryNum
GetQryNum = gQryNum
End If
End Function

SELECT GetQryNum() AS GuestIndex, Guest_Name, Account_Number, Count(Account_Number) AS [Falls]
FROM tblFalls
GROUP BY Account_Number, Guest_Name;

But all i get is a '1' in every row.

Any ideas?

View 11 Replies View Related

How To Create Reset A Autonumber After Every Year

Feb 18, 2007

Hi I am trying to make a database, In which I have a table linked with the form.
There are two fields in the table 1.Serial Number & 2. Current Year
I want the serial No. field to be incremented after every record is added & Also the numer should start from "1" again as the Current Year Changes.
Can somebody help me in this.
I am learning new things in access & not that proficient. But i love to work in access.

View 11 Replies View Related

Forms :: How To Create Autonumber Field

Sep 12, 2013

I created a database of "My Cars", "Television", and "Wines" and a Trouble Reports(TR) for each. I have a field TR on each and for now a user can fill it up with number i.e first TR is 1, second Tr is 2 etc etc. I want it automatically filled automatically not manually. However, I want it to do the same for "Television" and "Wines" when I write Trs on them. I am a rookie and I dont know how to do it I attached a copy of the db I created.

View 2 Replies View Related







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