I have a table in MS Access 2010 the fields are name, drug 1, drug 2, enzyme marker. The table looks like this:
Name-Field 1-Field 2-Enzyme marker
Mary Tylenol Aspirin enzA
Mary Aspirin Tylenol enzA
I would like to remove one of the records and not be left with duplicate records. Thanks, Carl
User Profile
Collapse
-
Removing duplicate records in multiple fields
-
Thank you for your help. I have revised my code and am having some success. However, I am having difficulty get the date and time fields to insert. I have changed their field names to DateTemp and TimeTemp. Can you please help me with the formatting of the insert statement for the DateTemp and TimeTemp fields? My current code is:
...Code:Private Sub Command35_Click() MsgBox "Me.Nurse4digitpw: " & Nurse4digitpw MsgBox "Me.Staff:
-
Access VBA Update query syntax
There are two tables Nursing_Note and Temp_Nursing_No te. Once the form Temp_Nursing_No te is completed the user enters a part of their password then hits a command button that triggers an UPDATE query. The code is giving me a syntax error, please help.
Thanks,
Carl23...Code:Private Sub Command35_Click() Dim strSql As String strSql = "UPDATE [Nursing_Note] SET [Temp_Nursing_Note].[Nursing_Note_Number] = [Nursing_Note]![Temp_Note_Number]," -
I was on the Microsoft website at
http://bytes.com/topic/access/answer...-username-help
does their TIP solve this problem?
Tip To prevent users from bypassing startup options, disable the Bypass (SHIFT) key by using Visual Basic for Applications (VBA) code to set the AllowBypassKey property of the database. For more information about setting the AllowBypassKey property, click the link in the See Also section...Leave a comment:
-
Hope this helps, the PK of the [Staff] table is the Employee_Num. Would it work to have the username accessible as a drop down combo box that also contains the PK?
Thanks,
Carl23Leave a comment:
-
Password username help
I have an Access 2010 database that I would like to give the Administrator, Manager, User or Viewer access to the database upon correct entry of their username and password on a form called Login. The username and password, as well as other related information is stored in a table call Staff. Pertinent fields of the Staff table are:
1. Employee_Num
2. Staff_Name
3. User_Name
4. Password
5. Status (1=Administrato r... -
I added the combo box in the header and have the form showing the patient number and full name. The Patient Information table is linked to the subform Nursing observation. How do I have the Patient Infomation and Nursing observation records only show the patient records related to the clicked on record from the combo box? Is this a on click event procedure?
Thanks,
Carl23Leave a comment:
-
Selecting one customer from multiple choices
I have a table with Patient Information. The fields are:
Patient_Number
Patient_Last_Na me
Patient_First_N ame
I have another table that contains nursing notes. The fileds are:
Patient_Num
Subject
Nursing_Observa tion
I have a select query that is initiated upon opening a form. The query allows the user to choose the last name. The query criteria is:
...Code:SELECT Patient_Information.Patient_Last_Name,
-
Thanks. Your anwswer should be posted as best answer but I don't see that box.
Thanks again,
Carl23Leave a comment:
-
Variable retaining value from InputBox
Thanks for your help. The code worked!!!!! It seems that your answer presents the variable as a variable with expanded wildcard type information. If there is an article on this, please direct me to it. Your answer should be marked as best response but I do not see the button on my screen.
Thanks again,
Carl23Leave a comment:
-
Another interesting item occurs when I add the following code just prior to the UPDATE query:
.Code:MyValue = InputBox("1. Enter Sheet #", "MyInputbox")
I find it interesting that the same box comes up and indicates 'enter parameter' and asks 'Enter MyValue'? Is there a method of avoiding answering the MyValue question.
Thanks,
CarlLeave a comment:
-
Variable retaining value from InputBox
I am importing Excel files into Access and trying to automate queries in order to manipulate and create reports. In a subroutine, several queries are run to CREATE and UPDATE a TEMP table.
In the beginning of a subroutine the user is asked for a variable, MyValue. The code is:
...Code:'Dim MyValue As Variant MyValue = InputBox("1. Enter Sheet #", "MyInputbox") tblname = "Sheet" & -
TEMP file UPDATE query VBA
I have 2 tables called ReportTracker and Sheet1. The fields are:
ReportTracker
1.Report_Num
2.Facility_Name
3.Unit
Sheet1
1.Repo_Num
2.Resident
3.Physician
4.Comment
Is there a template code for an UPDATE query that shows how to UPDATE multiple fields INTO a table called TEMP from the above tables? The tables have common fields [ReportTracker]report_num = [Sheet1]Repo_num?.... -
template for an UPDATE query that shows how to UPDATE multiple fields
Your template code works great for INSERT. Is there a template for an UPDATE query that shows how to UPDATE multiple fields INTO a table called TEMP from 2 other tables with a common field [TABLEA]report_num = [TABLEB]repo_num?
Thanks,
Carl -
I am trying to get all of the data into the TEMP table so the SELECT Query looks as follows:
...Code:SELECT ReportTracker.Report_Num, ReportTracker.Repo_Name, ReportTracker.Facility_Name, ReportTracker.Unit, ReportTracker.Repo_Date_1, ReportTracker.Repo_Date_2, ReportTracker.Repo_Date_3, Sheet1.Resident, Sheet1.Physician, Sheet1.Comment, Sheet1.Physician_Comment FROM ReportTracker, Sheet1 WHERE (((ReportTracker.Report_Num) Like [enter
Leave a comment:
-
TEMP table records from 2 other tables
I have 2 tables called ReportTaracker and Sheet1. The fields are:
ReportTracker
1.Report_Num
2.Facility_Name
3.Unit
Sheet1
1.Resident
2.Physician
3.Comment
I would like to create a TEMP table. The join can be created from the number '1' at the end of the Sheet1 table name and the Report_Num. I have been able to get the Sheet# before via inputbox:
...Code:MyValue1 = InputBox("Enter -
FYI, I am a pharmacy consultant to nursing homes and am actually using Access to import my reports that are generated in Excell to separate out the physician comments in a separate report. What I am trying to do is automate the process so the user can enter a minimal amount of information. That is why I am tring to import my Excel files as Sheet1, Sheet2 and not call them by their Excel file name ie Name of Facility, Name of Unit and Date...
...Leave a comment:
-
Difficulties in forming Update statement in VBA
I would like to update the table, tblname, to take in other columns and data from the ReportTracker Table so I created the following code:
...Code:Private Sub Command31_Click() 'add Report Tracker info into Sheet# Dim strSql1 As String Dim tblname As String Dim MyValue As Integer MyValue = InputBox("Enter Table #", "MyInputbox") tblname = "Sheet" & -
YIPEE! Once again, big thanks. Below is the working code for the UPDATE.
...Code:Private Sub Command35_Click() Dim StrSql As String Dim tblname As String Dim MyValue As Integer MyValue = InputBox("Add Column to Table--Enter Report Number that will be inserted in table", "MyInputbox") tblname = "Sheet" & MyValue StrSql = "ALTER TABLE ["Leave a comment:
-
Command35 subroutine has been modified per your suggestion and now works and reads:
...Code:Private Sub Command35_Click() Dim StrSql As String Dim tblname As String MyValue = InputBox("Add Column to Table--Enter Report Number that will be inserted in table", "MyInputbox") tblname = "Sheet" & MyValue StrSql = "ALTER TABLE [" & tblname & "] ADD COLUMNLeave a comment:
No activity results to display
Show More
Leave a comment: