Hi I've just signed up to the forum.
I'm currently working on a booking system, where clients can make appointments.
However as I am fairly new to access, I would like to know how I can inforce some sort of validation where for example if a client makes an appointment on 17/02/08, then it checks to see if there are any current appointments of theirs on the day, if there is, then an error message would occur
I have a medical database (Access 2003) containing information about patients. There is 1 form that is used to enter the information and a check box to say whether the patient has cancer.
I run a simple query to select the cancer patients.
I want to be able to add a large amount of information about (only) the cancer patients through a separate form. I also want a neighbouring hospital to be able to add cancer patients.
The ideal solution (I think) is to create an extra table to contain the extra information for cancer patients, and some of the informationfrom the original table. Cancer patients need to be automatically added to the cancer table once the "cancer" box is checked.
So far I have not ben able to achieve this - a create table query does not update automatically. I have tried creating a new table with the cancer information and creating a relationship between the tables and basing the form on the cancer table and a select cancer query. This does not work either.
Please can anyone suggest a solution! Do I need another database?
I am trying to sum values of duplicate data in a table using Make Table query. Can anyone help? I have attached a sample of the data. At the end of the day, the objective is to have a single line with the total of the multiple lines.
Anyone has experience for barcode. Example, if you scan the first time then it will appear total 1 and if you scan again with the same barcode, then the total will change to 2 ...etc.
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.
I have got a table that has following fields display on a form:
ClassNo Class Date ClassType ExecutionDate Order Quantity
The Table CLASSES has got many records which are duplicate. Mostly ClassNo is duplicated. I could have stopped duplication by restricting table not to accept duplicate values, but my requirement is such that i dont want to stop the table from accepting duplicate values. When i display the same table data on the form, all the duplicate entries are displayed.
All i need is to find a way to stop the FORM showing duplicate ClassNo Field. The Duplication restriction i wish to set only on ClassNo. If there are more than one ClassNo reptition than it should show that entry only once. For example the form looks like this:
ClassNo Class Date ClassType ExecutionDate Order Quantity 1 12-12-2006 A 12-01-2007 Ok 10 1 1 1 1 1 2 20-10-2006 A 20-11-2006 Ok 100 2 2 2 2
I wish to see the form this way:
ClassNo Class Date ClassType ExecutionDate Order Quantity 1 12-12-2006 A 12-01-2007 Ok 10 2 20-10-2006 A 20-11-2006 Ok 100
Regards,
Darno
Sorry i am posting it second time coz i got no response from any one, Hope this time some one genius might surface to help me.
I have a database that allows multiple entrys of the same information. I also have a report based on a query that pulls out said data.
I just need my query to pull out every record regardless if it is indentical to a previous one. I found under queries > design > properties there are two options unique values and unique records. According to a source online, these are what control allowing duplicates through, but I have swapped them around with no luck. Currently they are both set to "no".
Is there some other setting I have to switch up in order to allow the duplicates to come through?
I have a form that contains 5 fields and want to ensure that duplicate information is not entered. I am aware that when creating the form you can set Duplicate Records to No but each record has an AutoID which I assume means that even if the information is the same it will not register as a duplicate record due to the different AutoID.
There should only ever be 5 records entered per day. One for each region
I have created a Sanity Check that is displayed as a sub form that shows if the relevant information has been entered for a given day in Bookings and Backlog but this doesn't stop the user from putting in the same information twice. i.e. the User starts inputting the information gets called away and then trys to put it in again but doesn't check the sub form.
The Table in which the information is stored is called Bookings and Backlog.
The 5 fields on the form which is called Bookings and backlog are
ID (Autonumber) Date (Short Date) Combo26 (Text) (5 Regions:- North, South, East, West, Central) Bookings (Number) Backlog (Number)
I have put the following statement in AfterUpdate on the Combo26 field
If Me.Date = DLookup("[Bookings and backlog]![Date]", "[Bookings and backlog]", "[Bookings and backlog]![Date]=[Date]") And Me.Region = DLookup("[Bookings and backlog]![Region]", "[Bookings and backlog]", "[Bookings and backlog]![Region]=[Combo26]") Then 'Define Message Box MsgBox "The Region you have chosen already has data entered for this day." & vbCrLf & vbCrLf & "Please check your records and amend were neccessary.", vbCritical, "USER INPUT ERROR" Else End If
However I'm not to hot with writing VBA and probably got something wrong somewhere as it doesn't seem to do anything and lets the user progress regardless. I have tried amending the above script and asked it to look at just one field but this just seems to give the message regardless of the information selected in the Combo box.
Can someone give me an indication as to what I have done wrong so I can put it right and in a language that is easy to understand so that if I have a similar issue later on I don't need to post another question.
I have searched through the whole posts but could not find my query. I have a question related to prevent duplicate data entry in a form field.
I have a Form with 5 fileds on it: SNO, NAME, ROLL NO, CLASS, SECTION.
in the table design i have set the option of NO DUPLICATES on SNO(Autonumber) ROLL NO (text).
I wish to stop a user entering duplicate data in ROLL NO field before he reaches at the last field. What i meant is as soon as a user enters data in ROLL No field, it should check in table if the same data is already there. If the same data is found then it should give a message to prompt user of duplicate data, else it should continue to next field.
I have searched the whole forum but in vain. I am positive that there must be some one who holds the key to this solution.
Hi all: I currently have a database with a list of clients, and it is to be accessible to others to enter information on clients and to add new ones. However, I want to make it so that the user who wants to add a client can easily search the database for that particular client so that they won't enter a duplicate.
I have created a search function on my form, but then it occurred to me: what if there are two people with the same last name's? At first, I wanted a search operation to display a list of client names, along with their respective ID numbers and possibly a link next to each that would take the user to the corresponding record.
However, I have no idea how to do this, and I'm unsure as to whether or not this is the best way to tackle the problem. Please, someone show me the way!
This mind sound like a pretty lame question to the pro's....
Is it possible to duplicate an Access database creating a new blank database - retaining only the database/table structure? I have a website content management system and I want to duplicate the database for each new site.
Also, is it possible to reset the 'auto-numbering' to zero?
Whilst I've build a reasonably advanced web-based system based on a database containing a dozen or so relational tables plus queries, I'm no expert on advanced Access functions.
I have a database where a user imports data into a table monthly. She saves the Excel file and then clicks a button in Access to import the data. My instructions say to only click that button once, but so far, she has clicked it THREE TIMES, thus importing the data three times. How can I prevent this? Here is a copy of my import code:
Option Compare Database Option Explicit
Public Function ImportTableData() On Error GoTo ImportTableData_Err
Dim strPeriod1 As String Dim strMM1 As String Dim strYY1 As String Dim strYYYY As String Dim strFormName As String Dim strMDPath As String Dim strMDFileName As String Dim strDCPath As String Dim strDCFileName As String
'No Warnings DoCmd.SetWarnings False
'Import Current Month data in a temporary table DoCmd.OpenForm "frmEnterAgingDates", , , , acFormReadOnly, acHidden strFormName = "Forms!frmEnterAgingDates" strPeriod1 = Forms!frmEnterAgingDates.Period1.Value strPeriod1 = Format(strPeriod1, "mmddyyyy") strMM1 = Left(strPeriod1, 2) strYY1 = Right(strPeriod1, 2) strYYYY = Right(strPeriod1, 4) strMDPath = "S:FinanceAccounting OperationsNational AccountsAccount Recs116405.100 and 117630.300116405.100-AR Due from PAR Plans NASCO" strMDFileName = "MD AR Due from PAR Plans_" & strMM1 & strYY1 & ".xls" strDCPath = "S:FinanceAccounting OperationsNational AccountsAccount Recs116405.100 and 117630.300117630.300-AR NASCO Refund Due from PAR Plans117630-2007" strDCFileName = "DC AR Due from PAR Plans_" & strMM1 & strYY1 & ".xls"
Any way to query duplicate data from two different fields from two different tables in the same access 2010 project. I first quried the first part since it combines the first 3 columns to create another value (i.e. 52 & 60 = 5260).
So I created the concatenative value but now I have to compare to another field to display what results are found in both the concatenative and the other (APN in the file). I tried using query wizard but it is for only one field. I understand you have to use joins but the destination filed is what gets me.
I am putting the student names in a form. I want it to alert me that a name is duplicated. But thats not this simple. For example a name is Jennifer Locus but I type jenifer with one . Can access guess that this might be the same person and suggest me to correct the spelling or enter it as a new person?
I am trying to find duplicate data from two columns and I want to query the all the duplicates. I tried the query wizard but it only finds duplicates in the column itself. I am trying to compare the columns together and see what is found in column A that is also found in column B and also Vice Versa.
I currently assign multiple 'skills' to departments using a listbox and a combo using the following code
Code: Private Sub cmdSaveReq_Click() Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset
[Code]....
However as time goes on we may want to add new skills to the depts - ive used dcount to check if the data exists in one field before however how would it be possible to check to see if the data combination exists over deptid and skill
What I am trying to do is stop the ability to duplicating records over a series of fields (FirstName, MInitial, LastName, Company)rather than just one specific field.
The problem with this is it wont allow me to enter more than one person with the same first, middle, or last name or company.
I tried "DCount" Code in a form with no luck, that code reads as followed:
Code: Private Sub Form_BeforeUpdate(Cancel As Integer) If DCount("*", "tblEmployees", "[firstname]=" & Chr(34) & Me!firstname & Chr(34) & _ " And [MInitial]=" & Chr(34) & Me!MInitial & Chr(34) & _ " And [LastName]=" & Chr(34) & Me!LastName & "#") > 0 Then Msgbox "Person already exists." Cancel = True End If End Sub
Note: this code was initially used on a different database I was working on that accounted for an individuals First Name, Last Name, and Date of Birth which worked great. I am just trying to apply that similar concept to this new database with first name, middle initial, last name, and company; which will be a foreign key.
I have the following tables in my Access database.
A < B < C < D
(The "<" represents a one to many relationship.)A given row in table A can have up to 4 children (stages) in table B (stages 1 to 4).The other one to many relationships do not have any limitations as far as the number of children are concerned.All tables have AutoNumber primary keys.When the user clicks a button in a form, I want to:
Copy all data in the current stage (current row) in table B (corresponding to a given parent row in table A), to the next stage in table B.All data in child tables must be included in the copy process.In other words, for a given row in table A, by use of buttons in the forms for each of the stages 1 3, the user shall be able to do the following:
all data for stage 1 are copied to stage 2 (for user modification), then all data for stage 2 are copied to stage 3 (for user modification), then all data for stage 3 are copied to stage 4
I am preparing a "simple" training database. I want to do this smartly and not duplicate data.
My first table is the list of employees and their information. I have set a primary key (PK) up for each employee.
My second table is a list of training courses - title, description, start/stop time, credits, ... Each of these courses has a unique number (PK).
It's the final database table that is driving me nuts. I want it to show whether a n employee has taken/will take/not planning to take a course. My idea is to have a status field and then wanted to link that with a student number and a course number from the other tables.
In the past I would just have put common data fields StudentName from one table and CourseName from the other into the final database tables as a means of linking them. But I thought/read it's better to use a PK instead. Well when I make the third table up I get all of this Type Mismatch errors.
We have a client who has managed to muck up their Access database by means of having two users on two computers attempting to use and modify it at the same time, and the primary (actually, the only) location for the database is on Dropbox.
What seems to have happened is that Dropbox detected a conflict, with two different versions of the same file, and resolved this by creating two separate files. How long this went on before the client noticed that they were entering data into two separate files, I can't say.
Their client list is 28,000 someodd people long. What I need to know is if there's a process for merging the two files together, without creating 28,000 duplicate entries. This is being run on Access 2002.
I need to know if I can store data in more than one field, without allowing Duplicate entries.
Example: We have to send out letters with a claim number on it, sometimes we need multiple claim numbers on a letter, up to about 10 claim #'s is the most I've seen thus far.
We mail merge into Word to create the letters.
However, these claim numbers cannot be duplicated within the database and in order for this to work with the mail merge, I need several fields to store the claim numbers.
To be more specific. I probably have a bad data structure as I was kind of rushed and a little inexperience with putting the database together. It's for work and sometimes management just doesn't want to wait, they are so negative.
In brief, most everything is in 1 table and I know from reading this forum that I shouldn't do that, but that's another story.
Further, a claim# is tied together by the same claimant, the relationship code is what separates the claimant with the family, the insured id# is used for all claimants within the family.
You can also tie the claim# to a provider id#, some providers such as clinics and large hospitals have multiple providers that use the same provider id#, so a suffix code is used to separate the providers within that same #.
Please feel free to ask additional questions and I will give you the additional information you need to help me. Thanks again.
P.S. - Last year I created the database and this year I am improving it, so expect more posts from me in the future. I really appreciate all the help I get from everyone here!!!!
Having a problem when saving a record that has been edited and contains a duplicate field. Here is what I'm doing.
I have an existing record that is being viewed by the user. I have an edit button on the form that is displaying the record. When the user clicks the edit button I do the following
'User clicked on edit customer record
Private Sub CustEditRec_Click()
'Store current customer key in string so we can cross
'Set customer record test string so we can determine
'what the user is doing
CustomerRecStat = "edit"
' Go unlock the customer data fields for editing
UnlockCustomerFields
TxtCompanyName.SetFocus
'Go Unlock the customer editing buttons
UnLockCustomerAddButtons
'Lock the add, delete, edit buttons
CustAddRec.Enabled = False
CustEditRec.Enabled = False
CustDelRec.Enabled = False
'Go Disable the customer navagation buttons
DisableCustomerNavigation
txtCustomerKey.Visible = True
txtCustomerKey.Locked = False
txtCustomerKey.Enabled = True
'Set focus on the customer key
txtCustomerKey.SetFocus
'disable & hide the customer key combobox
cmboCustomerKey.Locked = True
cmboCustomerKey.Enabled = False
cmboCustomerKey.Visible = False
Exit_CustEditRec_Click:
Exit Sub
Err_CustEditRec_Click:
MsgBox Err.Description
Resume Exit_CustEditRec_Click
End Sub
The field which duplicate entries are not allowed in the table is txtCustomerKey. Now remember we are just editing a record NOT ADDING A NEW ONE.
When the user finished making the changes to the record we use the same procedure to save the changes as we when the user is adding a new record...here it is.
'User clicked save customer record
Private Sub CustSaveRec_Click()
On Error GoTo Err_CustSaveRec_Click
SaveCustomerRecord:
'Update the table data fields with the data contained on the form
'*** IF WE GOT THIS FAR WITH OUT ERRORS WE SAVED THE RECORD
'*** GO AHEAD & DISABLE THE FORMS VARIOUS FIELDS
'*** & BUTTONS ONCE AGAIN AS WE ARE JUST BACK TO VIEWING
'*** THE CUSTOMERS DATABASE
'Enable and unlock the customer key field
txtCustomerKey.Visible = True
txtCustomerKey.Locked = False
txtCustomerKey.Enabled = True
'Hide & disable the customer keycombo box
cmboCustomerKey.Locked = True
cmboCustomerKey.Enabled = False
cmboCustomerKey.Visible = False
'Set focus on the customer key field
txtCustomerKey.SetFocus
'Lock the customer fields
LockCustomerFields
'Enable the navigation buttons
EnableCustomerNavigation
'Lock the customer adding buttons
LockCustomerAddButtons
'Clear the record testing status
CustomerRecStat = ""
txtCustomerKey_AfterUpdate
Exit_CustSaveRec_Click:
Exit Sub
Err_CustSaveRec_Click:
'If the error generated was by a duplicate value.
'This can only be caused by the customer key as this
'is the only field which does not allow duplicate values.
'so warn the user of this duplicate value error and set
'the focus on the customer key field
If Err.Number = 3022 Then
'if user is editing a record
If CustomerRecStat = "edit" Then
'And the entered customer key has not changed
If Me.txtCustomerKey = EditCustKey Then
'Return to saving the record as the key is
'not really a duplicate
GoTo SaveCustomerRecord
End If
End If
Select Case MsgBox("This Customer ID was already located in the database. Click OK to enter a new Customer ID or Cancel to stop adding this record?", vbExclamation + vbOKCancel + vbDefaultButton1, "Duplicate Customer ID")
Case vbOK
Me.txtCustomerKey.SetFocus
Resume Exit_CustSaveRec_Click
Case vbCancel
'Go simulate undo record click
CustUndoRec_Click
Resume Exit_CustSaveRec_Click
End Select
End If
MsgBox Err.Description
Resume Exit_CustSaveRec_Click
End Sub
The problem is when the user is editing a record. The database assumes the txtCustomerKey is a duplicate in the table. However we are not adding a new record so the duplicate error is false. Its just that the txtCustomerKey is the same as the record being edited. Its not DUPLICATED its the SAME.....
Any help anyone? Sorry for the long post but I'm a strong believer in the more information the better when trying to solve a problem....
I need to know if I can store data in more than one field, without allowing Duplicate entries.
Example: We have to send out letters with a claim number on it, sometimes we need multiple claim numbers on a letter, up to about 10 claim #'s is the most I've seen thus far.
We mail merge into Word to create the letters.
However, these claim numbers cannot be duplicated within the database and in order for this to work with the mail merge, I need several fields to store the claim numbers.