Select And Write Keys From Two Records

Jun 7, 2007

Hello All,

If I want to select a row from subform A and a row from subform b and click a button and have the keys stored in another table what would be the best way to do that?

Thanks.

View Replies


ADVERTISEMENT

Modules & VBA :: Write Select Query That Will Search The Data From Bottom To Top Of Table

Dec 3, 2013

see below the code . The select statement searches the Printpoolno value from the top to bottom in table tblmaster. As in my table tblmaster there are thousands of records and it takes long to search for that Printpoolno from the table . Is there anyway we can write a query that will search the table from bottom to top as the Printpoolno will always be in the bottom records and not in the top records.

Code:

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim r As Long

[Code].....

View 3 Replies View Related

Write Several Records At Once

Apr 17, 2005

Hi there.

I have a contact table, and a mailing list table
Each contact can belong to one or more mailing lists. Hence a created a intermediate table to join the contact and mailing list tables, containing contactID and mailinglistID.

The problem is that when I want to register a contact in several mailing list, I need to be able to do it in one time :
For example, selecting the contact in a combobox, then affecting him to mailing lists by making multiple selection in a drop box or ticking checkboxes.

For example, I want contact 1 to belong to mailing list 3,6 and 8, wich would result in the jonction table in 3 records
1-3
1-6
1-8
without having to repeat 3 times the same operation for each mailing list.

Thanks for your help

(I m using access 97)

View 4 Replies View Related

Duplicate Keys - Records Jumping Screens

Apr 24, 2008

The problem now is when two data entry people are
working on the DB at the same time, sometimes the
client records one person is the are working on jump
from one computer to another computer.

Attached is an example caught:
Louise data entry user was logged into the database
on one computer entering data.
Mary data entry user was logged into the database on
a different computer entering data on a different
client.

The client data from Mary's computer "jumped" to the
screen of Louise's PC. And then worst to the
database table of contact data kept.

This is kind of hard to believe if there was not
screen images catching it in the act, which we have.
Is there a record locking MS-Access global setting I
need to turn on?


Also, we have at least 3 time where we get a duplicate MS-Access record-id key on the DB. That is not suppose to happen. I can e-mail the DB and mass out the real person(s) names if you would like.

Any of your great thoughts or insights will be appreciated.


Hope all is going good for you at America General and the earth quakes are not too shaking.

Thanks

Russ

View 7 Replies View Related

Problems With Records/queries/subforms/primary Keys

Aug 6, 2005

OK, I've tried everything I can think of with this query/subform/records problem. I've searched the internet for days, even bought some big fat Access reference books and read them cover-to-cover, but I still can't get my database to do what I want. This newbie would *really* appreciate some help...

I am trying to create a database which I can use to store clients advertising expenses. I currently have three tables: tblListings (which stores basic information about each client, with the field ListingID as the primary key); Advertising Rates (which stores the different types of advertising products and their prices, with the field ProductNumber as the primary key); and tblAdvertisingExpenses (which stores each order of an advertising product, including the clients ListingID as a foreign key, date, the type of advertising, and the total cost - the primary key is an auto-numbered field called OrderNumber).

I have a main form called frmListings, which displays the clients information from the tblListings table, and includes a subform. I wanted the subform to show only the advertising expenses corresponding to the ListingID (ie. client) displayed on the main form, so I based the subform on a query which displays all records from tblAdvertisingExpenses with a ListingID that matches the ListingID displayed from tblListings. So far so good - the records displayed in the subform change correctly when the record in the main form changes.

Now the tricky part

The subform displays a blank row for a new record, and I would like to be able to enter a new advertising expense in that blank record (date, type of ad, and cost), and have that data added as a new record in the tblAdvertisingExpenses table with a new auto-numbered OrderNumber. I dont know whether its because the subform is actually a dynaset from a query, or because Ive constructed the query incorrectly (highly likely, Im still pretty new to queries), but when I add in the details for the new record, I get the following error:

The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship (etc, etc).

I suspect that Access is attempting to write the record (along with the ListingID) back to the tblListings table, where the same ListingID already exists (uniquely) as the primary key. But I dont know for sure, because I dont really know what the heck Im doing. What I actually want to do is have the new record Ive entered in the subform added to the tblAdvertisingExpenses table, which is the record source for the qryListings query which displays records in the subform. It shouldnt be a problem, should it? So why cant I get it to work? Perhaps theres a fundamental flaw in the way Ive broken up the database into tables, or my assigning of primary keys and foreign keys. Or perhaps theres a flaw with the way Ive constructed my query. Or am I forced to have a completely separate form solely for entering data into the tblAdvertisingExpenses table? Or will I need to use a macro or VBA to accomplish what I want?...

Sorry if this is terribly confusing. I can provide more specific details (and screen captures) of the tables, queries, forms, and relationships (if I havent provided enough specific details already), and would really appreciate any help that anyone can provide. Help?!

View 3 Replies View Related

Write A Query That Will Return Records From Multiple Tables

Dec 19, 2012

I am trying to write a query that will return records from multiple tables. I currently get an error suggesting I create a subquery or else I get far too many records.

The query is EditAttendanceQuery (I left it in a bit of a state). The fields I need are shown in the query. The records I need are based on the Edit AttendanceQuery (Form). I can get the records I need without the CourseNumber and Section, but it all goes downhill when I include them.

View 14 Replies View Related

Queries :: Write Records From Field Of Query To Irrelevant Table?

Apr 28, 2014

I have a query with many fields. One of them is the combination of two fields and is called "Components Reference". What I try to do is, every time this query is updated, the records of only this field "Components Reference" to be written to the field of another table which also takes records from an another query. I wish I was clear enough.

View 13 Replies View Related

Modules & VBA :: Looping Through Records To Collect Data And Write To New Table

Jun 27, 2013

I am the first to admit I struggle with looping through records.

I am trying to loop through a table and collect external income data and write it to a new table.

My issue may be the way the table is laid out. ???

The attached pictures show the tables. The tblExtInc is where the data are. I am trying to create a table that looks like tblExtIncYr that shows each year and separate entries by item.

How would I loop through tblExtInc and grab ex:$2000 every year for upto 100 years but only get the $1000 for year 6,7,8 only?

View 2 Replies View Related

Queries :: How To Write A Query Which Selects Multiple Records From A Table At Once For Updating

Aug 14, 2013

I have a list box whose data is inserted in a table named as "test0" ,now in a macro of vba i want to select all the items in the list box and create there pdf files in a folder at my desired location. So far i have managed to create a pdf file of single item ,but i want to select multiple items at once ,

Code:
SELECT test0.ID, test0.item FROM test0 WHERE (((test0.item)=[ItemNumber]));

So, in this query itemNumber are multiple and i want to create there pdf files at once ..just on a click of one button ?

View 2 Replies View Related

Modules & VBA :: Write A Procedure To Send A Separate Email To Each Store That Contains Records Found In Table 2

Feb 9, 2015

I have two tables

1) has email address, and Store ID
2) has multiple records per store

I need to write a procedure to send a separate email to each store that contains the records found in table 2 ( excel format).

View 3 Replies View Related

Modules & VBA :: Possible To Export Select Records And Fields In Those Records To A Specific Location?

Jun 15, 2013

In an Access 2010 form is it possible to export select records and fields in those records to a specific location?

Code:
Set objDialog = Application.FileDialog(4)
With objDialog
.AllowMultiSelect = False
.Title = "Please select a File"
.InitialFilename = "C:"
.Show
If .SelectedItems.Count = 0 Then
MsgBox ("Action Cancelled")
Else

[code]....

The user can select the directory using the code above, but can specific fields in records be exported to a excel workbook in that selected directory?For example, if the are 5 records in the database can the fields LastName,FirstName,BirthDate in records 1,2,3 be exported to Setup.xlsx in that selected directory?

View 1 Replies View Related

Getting Query Criteria To Select All Records Or Specific Records In Query Design Section?

Jun 16, 2014

How can I get a Query Criteria To Select All Records or specific records in query design section.

I have a table that shows many departments with credit card transactions. I like to run a query to see specific department, or have an option to see all the departments when the query is run.

View 2 Replies View Related

Select Top 2 Records

Jun 12, 2007

Hi,
My question 'sounds' easy, but i can't think of a way to do this. Please help!

Ok, i have an 'employee' history table with 200K records. Each employee could have multiple records with different 'effective' dates(please see below for an example of two employees' records). What I want to do is to run a query where it will pick up ONLY the top TWO records of each emplyee. How would I go about doing this?

Thank you.

Joe


Employee History Table:
SSN--------------------EFFV_Date
123-45-6789---------------01/02/2006
123-45-6789---------------12/03/2001
123-45-6789---------------08/22/2000
222-33-4444---------------05/28/2003
222-33-4444---------------07/01/1995
222-33-4444---------------06/30/1990

Query result should be somthing like this:
SSN-----------------------EFFV_date
123-45-6789---------------01/02/2006
123-45-6789---------------12/03/2001
222-33-4444---------------05/28/2003
222-33-4444---------------07/01/1995

View 3 Replies View Related

Select Last 3 Records

Dec 20, 2004

How can I restrict a continuous form to select only the last three records

any help would be appreciated

Jabez

View 2 Replies View Related

How To Select X Random Records

Jun 20, 2005

I need to select 200 random customers from my table, how can I do that?

Table: tblCustomers
PK: CustID

View 1 Replies View Related

Select Range Of Records

Sep 1, 2005

Is there a statement that will allow me to select a range of records in the
middle of a selection of records? e.g. Rather than TOP 10, can I get like
records 10-20, or 50-65 etc?
Prodigy.

View 5 Replies View Related

Select First X Amount Of Records

Feb 27, 2008

Hello All

if I have thirty records and have the end user select the first 8 or what ever amount they want, could be 3, 14, 9 etc, is this possible via a form ?

thanks

View 13 Replies View Related

Calender To Select Records

Oct 24, 2006

I was wondering if anyone has seen a easy way to use a calender to select records rather than having to type in a "between such and such a date".

Because what i have now is a qry that pulls data from a table between two dates. And i would like to make it more GUI rather than typing to prevent user imput error if you understand what i mean.

I tried searching but didnt know what to search for.

Thanks for anyone that has any input!

Regards,
Jon

View 2 Replies View Related

Using A Form To Select Records

Jan 8, 2005

Ok I am probably goining nuts by now. I could have swore that I had a referance book that showed how to set up a form with multiple combo boxes that were used to filter forms/reports for desired records. Now I can't find that referance anywhere! Does anyone know how to do this or can they point me to a referance with this information? Please help me, this is one of the final touches I need for a project I have been working on for months.

View 6 Replies View Related

ListBox To Select Records... Please Help

Aug 5, 2005

Hello All...

I currently have a ListBox which I am using on a form as a "jump To..." record selector. It has to show 4 values to the users, and so far it has worked quite well. However, I recently added some queries to the footer of the form to help narrow down the data for searches, or if the user wants to see all open data of a certain topic. I'd like to have the ListBox "refresh" and only display the results of the query, but I cannot for the life of me figure out how to do it. The root of the problem seems to be that the initial SQL for the ListBox is selecting values from the under-lying table, and when the filter is applied, it simply doesn't care. When you click on entries that aren't in the filtered dataset, it doesn't error out or anything, and when you click ones that ARE in the filtered dataset, it does work properly... I'm close... How do I filter the listbox as well?

Thanks,

View 4 Replies View Related

Group And Select First Records

Feb 9, 2015

how I would write a code that will recognize information by same “ID” and then only take the first 6 years of that information. Each row has an ID and a corresponding year with other information associated with it. The data looks similar to this:

ID Year Avg HR
JohnSmith 1988 .789 78
JohnSmith 1989 .854 85
JohnSmith 1990 .456 85

TomJones 1978 .465 56
TomJones 1979 .165 85

View 9 Replies View Related

How To Select Records Starting From Number?

Dec 2, 2005

Hi!
Can anyone help me how to create query selecting only the records starting with the numbers?

Thanks a lot in Advance

View 1 Replies View Related

Returning Select Records In Query

Mar 30, 2006

Hello, I am sure this is quite simple, however I cannot figure it out. I have a query that shows tblPartNumber and tblAverage. The average is calculated in the query by taking the total minutes to assemble the parts, divided by the number of parts completed. What I am trying to do is run a query that will show me the most efficient (lowest average), time for each Partnumber. Ideally the query would show me something like this;


Part # Average
1234 .72
1234 .86
1234 .94
etc...

I searched on here and it seemed like the Top 10 is used, but in my application that ommits all of the other partnumbers because it only shows ten of the records for the first partnumber. I only want to see the five most efficient averages. Any help is greatly appreciated.

Thanks, Tim

View 3 Replies View Related

Query To Select The Duplicated Records.

Jun 23, 2006

Hello,

I want to make a query that retrieves me all the duplicated records from a table. Its possible?

Thankx

View 1 Replies View Related

Select Query Showing Too Many Records

May 27, 2007

I have two tables, bad design, not my choice of the way it's set up.

Table a has Fields 1-2, dups allowed in all fields. No pk was originally assigned.
Table b also has the same fields 1-6, but also has field 6.

Table a has all of the records in question, table b only has some of the records from table a but does not have any records that are not in a.

Something like this.
Table a

Field1 Field 2 Field 3 Field 4 Field 5
John Shirt blue denim button
Mark pants green straight
John Shirt blue silk button


Table b

Field1 Field 2 Field 3 Field 4 Field 5 Field6
John Shirt blue denim button new
Mark pants green straight used


If I query the two tables, a left join to b, then I get the correct number of total records. If I select any records from b, then the total records goes higher than there are, even for the two combined, listing the same record multiple time.

Any suggestions are appreciated. I am a blood bank lab person, not an IT person, or DBA, so simple responses are greatly appreciated.

View 6 Replies View Related

Select Only Records For Specific ID Query

Jul 31, 2007

This is killing me,

I have a form with a unique ID, I have a query that pulls all data regardless of the ID on the form.

How can I get the Query to pull only the data for the ID that is currently in view on the form?

Please help..

Thanks,

Fen How

View 2 Replies View Related







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