Avoid Repetitive Values In Several Fields
Nov 21, 2006
I have a table similar to this
table
-----
ID
field1
field2
field3
'ID' is the primary key but I want MS-Access to have an eye on field1-3 to avoid entering the same information into field1-3.
How can I do this?
(Using field1-field3 as primary keys is not desirable)
Please help.
Thanks in advance.
xxyy
View Replies
ADVERTISEMENT
Dec 31, 2010
I have a report which has say two columns - staff number and visit date. For a staff number (which is unique) there may be more than one visit date. But I want to list a staff number only once and not multiple times in the column (but want all the visit dates of course). How can I do that?
View 14 Replies
View Related
Jul 18, 2005
I've read on this forum that memo fields can be a spot of bother. I only saw this after I put several memo data types in my tables. I wasn't going to do that much with them; it was intended as a electronic scratch pad of sorts for the user. Where does the trouble arise from with them? Should I just leave them or should I change them to text fields with 255 chars and hope that's good enough?
scratch
View 1 Replies
View Related
Nov 25, 2007
Hello! i have created three tables and inserted different records in them. I want only "genes" records from table 1,2 and 3 to be shown. The problem I am having is that when I design the query and ran it, it shows me all the possible combinations of records instead of showing only 1 record.
Table 1 - Number - Population - Genes
Table 2 - Number - Genes
Table 3 - Number - Genes
Table 1 - Records
==============
Number 1 - India - AB48
Number 1 - Pakistan - AB35
Number 1 - South korea - AB48
Table 2 - Records
=============
Number 1 - BD34
Number 1 - GF45
Table 3 - Records
=============
Number 1 - HG65
Number 1 - LK98
SQL
=====
SELECT Table1.Number, Table1.Population, Table1.genes AS Table1_genes, Table2.genes AS Table2_genes, Table3.genes AS Table3_genes
FROM Table3, Table2, Table1;
Now the question is that either I need to use Criteria or Filter to show the each record from the table. The problem I am having is that when I run this query it shows me all the possible combinations of each record from the table.
I want to show only the records which are in those fields and nothing more or less.
Could you please help.
SIZE="1"][Please note: The database I have shown here is an example and does not reflect my personal database however I have made an example to show what i am trying to achieve here][/SIZE]
Many Thanks
Jay
View 4 Replies
View Related
Sep 24, 2007
I have been working on a Query to sort through a list of companies. I am trying to query the company name to include ALL entries that have the include key(from another table) anywhere in their company name... It is supposed to exclude all entries with ONLY the exclude key(from another table)... If it has the exclude key AND the include key or neither key then the entry should be included... Then it is supposed to use all of the entries added from the previous sorts and include ONLY the entries where the zipcode matches one from a ZIPCode list.
Below I have listed the tables with their variables and my attempt on the query:
Include Table (tblinc)
ID
Inckey
Exclude Table (tblex)
ID
exkey
List Table (list)
ID
Company
Address
City
State
ZIPCode
…
ZIPCode Table (ZIPCode)
ID
ZIPCode
Query withZips <--- my attempt... doesnt work 100% ALOT OF REPETITIVE ENTRIES
SELECT DISTINCT tblinc.inckey, tblex.exkey, ZIPCode.ZIPCode, *
FROM ((list LEFT JOIN tblinc ON list.company Like "* " & tblinc.inckey & " *") LEFT JOIN tblex ON list.company Like "* " & tblex.exkey & " *") INNER JOIN ZIPCode ON list.ZipCode Like "*" & ZIPCode.ZIPCode & "*"
ORDER BY inckey DESC , exkey;
This has become urgent... If you can help, please respond asap...
View 9 Replies
View Related
Oct 11, 2005
Hoping for some assurance and assistance....
I am needing a database that will help to manage employee leave (holiday) requests. I have one but the current design is a bit...... well, you know.
Leave Limits are (presently) applied by one table:-
tblLimit
-------
payWeek
workType (twentysix work types some common to all sites, some apply only to one or two sites)
LimitSiteA (three sites)
LimitSiteB
LimitSiteC
LimitAllSites
So, several "faults" are immediately apparent:
LimitAllSites is ALWAYS the sum of LimitSiteA+LimitSiteB+LimitSiteC so
clearly shouldn't be there, and I don't even want to talk about that....
Also , no primary key, repeating columns... uh-oh!
Therfore....
tblLimit
-------
limitID (PK)
payWeek (date/time - always a Wednesday, our payWeek begins on a Wednesday)
workTypeID (FK to new table tblWorkType)
siteID (FK to new table tblSite)
Limit (integer)
However....with just a brief investigation, it transpires that of the 1600+ rows in this (current version) table, there are only 69 unique sets of limits (ran a Unique Values query, excluding the PayWeek).
So, what I do want to talk about is not having to add in a table row for each WorkType for each PayWeek (for each site- with the improved design). I want to apply a general set of limits, with effectiveFrom and effectiveTo dates, per Site/workType combination, which should automatically populate out 80 weeks into the future (historical records are not required - it is just to help plan future leave) and then cater for the exceptions by "adjusting" the general limits in one of two ways:
1) every day over a date range (e.g. every day between 15NOV05 and 15DEC05, decrease the limit for worktype Z in Site A by 10 percent of the BASE* limit).
2) every nominated weekday over a date range (e.g. every Friday in December 2005, increase the limit for worktype Z in Site A by 20 percent of the BASE limit).
*the two adjustment types need to be independent, overlappable, and have a cumulative effect.
e.g. for the above, if the general limit for type Z of site A were 100
14 NOV --> limit 100 = 100 (no adjustment)
15 NOV --> limit 100-10 = 90 (adjustment per #1)
.
. - repeat concept as above
.
30 NOV --> limit 100-10 = 90 (adjustment per #1)
01 DEC --> limit 100-10 = 90 (adjustment per #1)
02 DEC --> (Friday) --> limit 100-10+20 = 110 (adjustment per #1 & #2)
03 DEC --> limit 100-10 = 90 (adjustment per #1)
.
. - repeat concept as above
.
15 DEC --> limit 100-10 = 90 (adjustment per #1)
16 DEC --> (Friday) --> limit 100+20 = 120 (adjustment per #2)
17 DEC --> limit 100 = 100 (no adjustment)
etc
It gets dirtier !
There are two broad types of leave - general - for which the limit is determined/applied at the (site+workType) level, and "long service" for which the limit is to be applied at just the site level (workType has no bearing).
I was OK up until it got "dirtier" - now I am not so sure....
I was thinking...
tblLimit (base limits)
-------
limitID (PK)
workTypeID (FK to new table tblWorkType)
siteID (FK to new table tblSite)
limit (integer)
effectiveFrom (date/time)
effectiveTo (date/time)
Does my base limit table store WorkTypeID, but as null when the record relates to "long service" leave, and as a valid WorkTypeID when the record relates to "general" leave ? If so, is it of sound design to derive the broad leave type from the "nullness" of the workTypeID, or is it recommended to store that separately?
Similar questions relate to the adjustment table, for both WorkTypeID and WeekdayID...
tblLimitAdjust
-------------
limitAdjustID (PK)
workTypeID (FK)
siteID (FK)
adjustFactor (double)
WeekdayID (FK)
effectiveFrom (date/time)
effectiveTo (date/time)
I was sort of hoping that writing this out may help clarify my mind on some of the points.... which it did, but only to a limited extent so....
Suggestions / corrections / Pointers ???
Regards
John.
View 2 Replies
View Related
Sep 24, 2007
I have been working on a Query to sort through a list of companies. I am trying to query the company name to include ALL entries that have the include key(from another table) anywhere in their company name... It is supposed to exclude all entries with ONLY the exclude key(from another table)... If it has the exclude key AND the include key or neither key then the entry should be included... Then it is supposed to use all of the entries added from the previous sorts and include ONLY the entries where the zipcode matches one from a ZIPCode list.
Below I have listed the tables with their variables and my attempt on the query:
Include Table (tblinc)
ID
Inckey
Exclude Table (tblex)
ID
exkey
List Table (list)
ID
Company
Address
City
State
ZIPCode
…
ZIPCode Table (ZIPCode)
ID
ZIPCode
Query withZips <--- my attempt... doesnt work 100% ALOT OF REPETITIVE ENTRIES
SELECT DISTINCT tblinc.inckey, tblex.exkey, ZIPCode.ZIPCode, *
FROM ((list LEFT JOIN tblinc ON list.company Like "* " & tblinc.inckey & " *") LEFT JOIN tblex ON list.company Like "* " & tblex.exkey & " *") INNER JOIN ZIPCode ON list.ZipCode Like "*" & ZIPCode.ZIPCode & "*"
ORDER BY inckey DESC , exkey;
This has become urgent... If you can help, please respond asap...
View 1 Replies
View Related
Jun 6, 2007
Hi,
I am creating a small database to house results of certain tests. Is there a function in access that allows me to add fields if a result is out of the specification required. In other words I still need to record the out of spec results but I also need more fields to appear for the next lot of results to be entered, for example.
When cooking a batch of product I need to test the pH at the 30 minute mark if the pH is too low I will continue cooking the product for another 30 minutes and then test the product again. The cook time is not a constant so I never know how many samples are required, therefore I don't know how many fields i would need in advanced.
View 3 Replies
View Related
Apr 28, 2006
I have inherited a 5 table database which is associated with membership details and all tables are linked via the membership number which appears in every table..eg
Main Register
membernumber, surname, forename, age etc etc etc
Home address
membernumber, address1, address2, address3, postcode
Business address
membernumber, company name, address1, address2,etc etc etc
Subscription
membernumber, grade, subscription, bank account, etc etc
Training
membernumber, college, results, etc etc
I am informed that it is bad practice to have duplicate data in multiple tables (ie. membernumber field) as updating the data item would be difficult (eg. if the members number needed to be changed for any reason). If this is the case how would I restructure the tables but maintain the link through the membernumber?
I am fairly new to Access....as you can no doubt tell.
View 4 Replies
View Related
Dec 14, 2006
is there a way that I can compare the ID number from a combo box selection and a table... in order to avoid duplicating that same entry?
ie
If me.cbo1.column(0) = [table name].[field] then
me.cbo1.column(0) and me.cbo1.column(1), etc... = vbWhite
End if
What I am ultimatly trying to accomplish is a way to get rid of one selection in a combo box after it has been selected once and used for another record. is the .requery a better method... if it is, can someone please elaborate on how to use that a little more.
View 2 Replies
View Related
Jun 16, 2007
Hi
I need to know how to avoid from overlapping between times per date when the user is isernt a new data.
I thought to use dllookup function but it finds one result but if there is more than one result.
Date Ent Ext
1/1/2007 8:00 17:00
1/1/2007 9:00 16:00
1/1/2007 10:00 15:00
In this case there is overlapping and I need a code that avoiding this situation.
Thanks
View 1 Replies
View Related
Mar 6, 2006
How can I avoid the auto save record in Accesses? I want save the record under definite conditions.
View 1 Replies
View Related
Jun 13, 2005
Hi all,
I have an append query that I run daily and want to append only records with
different OrderID.
------------------------------------------------------------------------
INSERT INTO tblConfirmSchedule ( OrderID, JobCode, JobDate, Status, [Home#],
[Work #], Ext, [Other#], Ext2 )
SELECT Orders.OrderID, [Schedule Info].JobCode, JobSchedule.JobDate,
JobSchedule.Status, CustNew.[Home#], CustNew.[Work #], CustNew.Ext,
CustNew.[Other#], CustNew.Ext2
FROM (CustNew INNER JOIN Orders ON CustNew.CustomerID=Orders.CustomerID)
INNER JOIN ([Schedule Info] INNER JOIN JobSchedule ON [Schedule
Info].JobCode=JobSchedule.Scheduled) ON Orders.OrderID=[Schedule Info].OrderID
WHERE (((JobSchedule.JobDate)>Now()+3) And
((JobSchedule.Status)="Scheduled"));
--------------------------------------------------------------------------
Any ideas?
Thanks in advance,
Emilio
View 1 Replies
View Related
Nov 28, 2005
2 tables in an Access database
tblPurchases: columns: Index (PK-autonumber)| Store| Product| Cost
data: 1| Staples | Tape | $0.89
2| Staples | Paper | $4.50
3| OfficeMax | Markers | $3.50
4| OfficeMax | Paper | $4.75
5| OfficeMax | Pens | $1.98
tblInfo: columns: Index (PK-autonumber) | Store | Product
The data in the access database tblInfo.Store is queried from tblPurchases.
Here is the query for the rowin my database design view:
SELECT DISTINCT tblPurchases.Index, tblPurchases.Store FROM tblPurchases;
When I am in the database and access the column's pull down, I get ALL records, including duplicates (so OfficeMax is listed 3 times.) How do I get it so I only see
Staples
OfficeMax
in the pull down when in the database?
Thanks!
View 4 Replies
View Related
Aug 15, 2005
I have a form based on a lengthy SQL query.
I have several controls in this form whose control Source has the following formula:
=Nz(DSum("Capital","Capital_Act","DatePart('q', CVDate([Capital_Month] & ' 1')) = 1 And [projectid]=" & "'" & [projectid] & "'"),0)
When I navigate from one record to another record in this form, the values in the controls take a looooong time to populate (most of the time they come up as blank and when I move my mouse over that control - the value gets populated....this is slow !!!).
I believe this is happenning because I am using DSUM function all over the form.
What is the fastest way to display this control WITHOUT using DSUM?
Many thanks!
View 4 Replies
View Related
Dec 13, 2005
Ok, here's the deal. I'm tired of fixing our gigantic table because of corrupt records in my firm's database. I find that the problem ordinarily comes up when someone opens the same record in two different forms (whether on the same computer or on a different machine) and both attempt to make changes. Is there a way (preferably simple) to just LOCK a record in a particular table to keep this from happening? I assume there has to be, but I've just never taken the time to find out. I'm not sure if this locking is done on the form level or somewhere in a table option or something.
View 1 Replies
View Related
Mar 25, 2006
Hi guys
i really hope this is possbile...
i want to have one form, that relates to about 70% of the data in one table. however, the remaining controls will be coming from 3 other tables. i cannot for the life of me figure out how to create a form that will display these controls for all 4 tables on a single page.
every attempt i make with the wizard makes me the form with 3 subforms that the user has to scroll across the page to use. i need to have all my controls pretty much lined up on the page without moving horizontally across the screen to enter data
ive tried creating a form by dragging the fields into it in design view from the primary table, but i cant see how to include (or drag) fields from my other tables into this form
does anyone know of a solution to this problem?
thanks
View 1 Replies
View Related
Mar 21, 2014
I have the follwing three quantities: category, month and value.so I would like a report to place each value in the corresponding row (category) and column (month).using a cross tab query this is quite easy, and I also managed with a simple query, by placing 12 textboxes in the report and using the iif instruction (iif month-jan,value,null and so on for each month).
now the problem arises when i have two values for the same category but in different months. In this case, the report will place the last value in the line below the previous, leaving a blank space.I'll upload an example asap, in the meantime i try to explain it here below:
.......jan..feb..mar..
cat1 10
cat2 30
View 1 Replies
View Related
Sep 8, 2014
I have a master to child table relation which is one to many. Each one is represented by a different form.
The problem is, the user enters the primary key "JobID" on the master form, then he needs to enter a few records on the child list with the same "JobID" which is the foreign key in that case. I don't want the user to enter the "JobID" every time he enters a new record in the child form.
Is there a way I can copy the primary key to the foreign key each time the user enters a new record in the child form?
View 2 Replies
View Related
Oct 14, 2011
I have the following code (below) that I use to allow the user to select a particular value to determine which records to delete. However, I was wondering if there was a way to avoid having the Microsoft Access auto-generated messages pop up.
For this particular case, after the user selects the value and hits the command button, then a msg box comes up verifying if the user wants to delete the records with selected value. Clicking 'Yes' will then generate the Access message that asks the user again if they want to delete the records and that these actions can not be undone. Clicking Yes here will delete the records.
However, clicking 'No' or x'ing off this Access generated message will then cause a Run-time error 2501. I want to handle this error if it all possible.
Code:
Private Sub CmdRemove_Click()
Dim strQuery As String
DoCmd.Beep
If vbYes = MsgBox("Are you sure you want to delete? Clicking 'Yes' will completely remove all prospects with the selected Class from the database", vbYesNo + vbQuestion, "Delete prospects?") Then
strQuery = "DELETE * FROM [Prospects] " & "WHERE Prospects.Class = '" & Forms("Classpopup").cmbRemove & "';"
DoCmd.RunSQL strQuery
End If
End Sub
View 3 Replies
View Related
Oct 28, 2004
Is there a code for event procedure OnEnter() that allows me to expand my list box so that i can see a list that's larger than the size of it. I was hoping to multiple select from the list and do it at a glance because my list is very long.
View 1 Replies
View Related
Sep 8, 2014
I have a master to child table relation which is one to many. Each one is represented by a different form.
The problem is, the user enters the primary key "JobID" on the master form, then he needs to enter a few records on the child list with the same "JobID" which is the foreign key in that case. I don't want the user to enter the "JobID" every time he enters a new record in the child form.
Is there a way I can copy the primary key to the foreign key each time the user enters a new record in the child form?
View 8 Replies
View Related
May 18, 2015
I created the .accde to distribute only the compiled file. But I have a problem. When you open the file .accde there is this problem of security: You can not determine whether the content is from a trusted source. Leave off the contents, unless they provide essential capabilities and the source is considered reliable. Open the file or cancel the operation? How Can I avoid the visualization of this security alert?
View 11 Replies
View Related
Jun 14, 2013
I have an Access 2007 mydb.accdb file. If I click on it, it starts up fine. If I click on it again, then focus goes to the already open db.
If I do the same but with the .accde of the same db, for each click a new instance opens. This is not good, in that a single user then can have multiple instances running without noticing it, and that might mess things up. What Windows setting to use, to convince Win XP that only one instance of mydb.accde should run, similar to the .accdb?
View 2 Replies
View Related
May 7, 2014
Once you open the db. open up the frmQuoteLog and the frmPDMontior. You will notice one record is displayed in the frmPDMonitor (Justin Ryan). This is correct.Now to test out the issue leave open the frmPDMonitor and frmQuoteLog at the same time. Go to frmQuotLog, go to the first record, make the "Sales Coordinator" = "Chris April", then check the box that says "Display on Product Design Monitor", then press the "Save Changes" button.
Then look at the frmPDMonitor and you will notice the new record is now displayed on the form. This is correct as well.Leaving open both forms, go to frmQuoteLog and uncheck the box you previous checked on the first record, then press "Save Changes".
Then look again at the frmPDMontior and notice that the previous record is gone but the remaining record is now duplicated.Only when I close the frmPDMonitor and reopen it, does the duplication go away.How can I avoid this duplication without closing and reopening the frmPDMonitor? The purpose of this form is to be ran 24/7.
View 14 Replies
View Related
Oct 8, 2013
I want to add best 3 quiz marks from 5 quizzes appeared in a term. How can I build an expression for solving this problem in the expression builder.
It is possible in MSExcel writing this formula = Sum(Large(E3:E7,1),Large(E3:E7,2),Large(E3:E7,3))
View 2 Replies
View Related