Modules & VBA :: MS Access 2010 String Records Of Two Tables

Feb 14, 2014

I have two tables linked via Project ID as shown in the attached file. I need Module to concatenate Project sub types against Project Types.

View Replies


ADVERTISEMENT

Tables :: Merge Duplicate / Similar Records Into 1 Record In Access 2010

Jun 9, 2014

Is there a way to merge duplicate/similar Access 2010 records into one record?

I have an Access table with 1,000 duplicate records, although they are similar and not exact duplicates. As you can see below, some records contain information that other records do not. Yet, the primary key is the same for all duplicate records. I want to find a way to merge data from filled cells of duplicate records into empty cells for each duplicate record. I do not want to concatenate the data (i.e. combine last and first name, etc.). I only want to fill empty cells if there is a match for it in a duplicate record. I will delete the newly exact duplicate records later. Short of correcting the records by hand.

Example

Code:
LastName FirstName SSN Address Phone Email
Doe John 123-45-7891 123 Anywhere St. NULL john(at)gmail.com
Doe John 123-45-7891 NULL (123)456-7890 NULL

Desired Result

Code:
LastName FirstName SSN Address Phone Email
Doe John 123-45-7891 123 Anywhere St. (123)456-7890 john(at)gmail.com
Doe John 123-45-7891 123 Anywhere St. (123)456-7890 john(at)gmail.com

View 2 Replies View Related

Tables :: Data Lost In Access 2000 Tables With Access 2010

Oct 9, 2012

We have an Access 2000 backend database resides in a network server drive while users connect to the backend tables with a mde file on their computers. All users have Access 2010 and the mde file was converted from the 2000 frontend with Access 2010.

The database have been running for a few weeks but recently users have been complaining about record lost on the backend table.We have also experienced one incident of data corruption where the main table could not be opened. After Compact & Repair, the table could be opened but a few records were showing xxxxx on all the fields and we have to delete and re-enter these records.Would they relate to using 2010 mde converted from 2000 frontend when the backend is still in 2000? I am a little nervous about converting both the frontend and backend to 2010 since I have heard various issues on the new version.

View 1 Replies View Related

Tables :: Access 2010 SQL Statement With Tables And Query

Sep 3, 2014

I am using Access 2010.I have a table that I am using to pull my data from other tables and a query.My table is called tblMyData.One of the field names is level1. This field points to another table, and gives the user the choices for states (examples California, Texas, Maine).

Another field name is level2. This field points to another table and give the user the choice for type of customer (examples Business, Consumer)
The field name level3 points to a query. The query, qryFinalChoice matches up the choices based on level1 and level2.for example, the user can pick California for level1, business in level2 and California Widgets or Los Angeles Clothing store in level3 (plus about 20 other choices).

If the user picks Texas for level1, business in level2, business in level2 and Houston rugs, or Texas style restaurant in level3 (or about 15 other choices).

-I am recording 1 for California on level1, 2 for Texas and 3 for Maine in level1.
-I am recording 1 for business and 2 for consumer on level2.

The query qryFinalChoice has all the combinations for state, business or consumer, and lastly business name or consumer name.

-qryFinalChoice has line1 to match up the choices for level1 in my table.
-qryFinalChoice has line2 to match up the choices for level2 in my table.
-qryFinalChoice has line3 to match up the choices for level3 in my table.

I do not want any of the Texas business names appearing when the user picks California, or vice versa.

My SQL in my tblMyData tab for level3 looks like this:
Select line1 from qryFinalChoice where line1=1;

I am able to get all the line items where California is a selection.How do I change my SQL to pull all the line1 choices where I have selected from level1, and all the line2 choices where I have selected from level2 automatically based on my pulldowns?

View 1 Replies View Related

Tables :: Access 2010 / How To Rename Linked Tables

Nov 11, 2014

I have a split database.(Access 2010).Three of the linked tables are Appointments, Appointments_OLD, Appointments_NEW.

I want to use vba to rename Appointments as Appointments_OLD (replacing the current one) and to rename Appointments_NEW as Appointments (replacing the current one)

I have used:

'replace Appointments_OLD by Appointments, replace Appointments by Appointments_NEW
DoCmd.Rename "Appointments_OLD", acTable, "Appointments"
DoCmd.CopyObject , "Appointments", acTable, , "Appointments_NEW"

Unfortunately this just made Appointments and Appointments_NEW clones of one another - changes in one automatically occur in the other.

What I actually want to do is to swap the names round in the backend database while maintaining the right links to the frontend.

Is this possible using vba in the frontend?

View 1 Replies View Related

Access 2010 / Merge Several Tables Into One

Apr 22, 2013

merging seven tables with the same layout, but different information from different groups into one main table.

View 6 Replies View Related

Access 2010 / Linked Tables Not Updating?

Jan 4, 2012

I have an access 2010 Database connected to a MySQL database through a ODBC 5.1 connector.

when I run the linked table manager, I get the message "Linked tables updated successfully" but the tables residing on the server do not update.

View 1 Replies View Related

Modules & VBA :: Database With Records - Search For Similar String

May 20, 2014

I am trying to write some code to search for similar strings. I am creating a database with records that all contain street addresses. These addresses may have more than one record attached to it, and we would like for folders to be created containing the records with similar street addresses. Problem is, all the existing records are from an excel spreadsheet that did not contain any data validation, so there are several instances of:

123 Street
123 st
123 street job 1
123 st job 2
etc....

So I am trying to write code to prevent this from happening in the future, by searching the database for a similar street address and asking the user if this is the address they are trying to enter. I have been trying to do this with the DLookUp function, as such:

Private Sub ProjectName_AfterUpdate()
Dim stLink, pName As String
pName = Me.ProjectName
stLink = DLookup("[ProjectName]", "tblMaster", "[ProjectName] LIKE '" & pName & "%'")
If IsNull(stLink) Or stLink = "" Then

[Code] ....

I have worded the stLink line different ways, and have used (*) instead of (%) but nothing is working. The CODE is working, as in no errors, but it is not finding a similar project that I know is present.

View 14 Replies View Related

Tables :: Access 2010 - How To Display Table Size

May 14, 2013

Is there a way to display the size of the tables? I am using Access 2010.

View 4 Replies View Related

Tables :: Access 2010 - Calculated Field Cannot Be Created

Feb 22, 2013

I have table of transaction data, I want to count the number of successful customer transactions but the table includes cancelled transactions with a negative value. I was therefore looking to create a new calculated field for customer count which report either "1" or"-1" depending on if the price is positive or negative. The idea being a count of this would give the customer count. The expression I am using is:

IIf([Price]>=0, 1, -1)

The problem is it I get an error message saying "The calculated field cannot be created" "verify that expression "IIf([Price]>=0, 1, -1)" includes fields that exist in the current table"

View 2 Replies View Related

General :: Access 2010 - Email Records In Body From Table

Oct 1, 2013

I've set up a piece of VBA code to loop through and email various recipients data, in the form of records within the email body. This works fine, but occasionally produces an error whereby the email output body lines are duplicated spuriously. This only seems to happen when running a large number of email loops.

The data source for the email body content is a table, which for each 'loop' is refreshed with new data by 1) deleting records from that table, and then 2) appending data to the table.

The portion of code for the loop & email:

Do
'Build outputbodytext
DoCmd.OpenQuery ("EmailQ2")
DoCmd.OpenQuery ("EmailQ1")
'set up email
Set rec2 = CurrentDb.OpenRecordset("outputbodytext")
strSendTo = rec2("Email")

[Code] .....

View 3 Replies View Related

General :: Access 2010 / Adding Reports To Records As Attachments?

Apr 12, 2013

I have an Access 2010 database connected to several SharePoint lists. I'd like to be able to print a report (based on a query) and add that report as a .pdf attachment to the record I was looking at when I generated the report.

At the moment I can save the report as a .pdf to a local file store, then upload it as an attachment, but is there any way to skip that step and add it to the correct record automatically?

View 3 Replies View Related

Queries :: Update And Insert Records With SQL Statements Using Access 2010

Jul 10, 2014

I am trying to update and insert records with SQL statements. Below my code:

Select Case FirstGRV
Case "Y"
sql = "UPDATE Tbl_SellingPrices " & _
"SET SellingPrice = " & Me!Text2 & ", SellingPriceDateFrom = date(), SellingPriceDateTo = #" & Me!Text3 & "#" & _
"WHERE SellingPriceStockCode = Forms!Frm_GRV!GRVStockCode and SellingPriceDateFrom =#01-01-1900#;"

[Code] ....

My problem is I need to know if the execution of the SQL statement was successful or not. I use the RecordsAffected method, but it always returns 0, no matter what.

View 14 Replies View Related

Forms :: How To Scroll Through Records In Access 2010 With Mouse Wheel

Mar 6, 2015

I want to scroll through records in Access 2010 forms with the mouse scroll wheel.

View 10 Replies View Related

Access 2010 - Pulling TOP / Max Number Of Records User Prompted For Value

Oct 23, 2013

I would like a user to specify the total number of records they need from a query result. The result must be random, therefore cannot filter on any field or data in the table.

On a form, the user enters the total # of records they need and selects a button that executes this:

DoCmd.RunSQL.SELECT DcountRDP.RDP_IND, DcountRDP.GRP_ST_CD, DcountRDP.AUDIT_STATUS, DcountRDP.AUDIT_TYPE, DcountRDP.AUD_ID, DcountRDP.ACURT_IND, DcountRDP.AUD_DT
FROM DcountRDP
WHERE DcountRDP.MaxRecords = [Forms]![Open_Frm]![IL]

This is not working at all.

How can I make it possible for the user to enter a total needed or be prompted to enter a total and then randomly produce the first top # of records that they specify?

View 1 Replies View Related

Modules & VBA :: Using String To Update Records - Quotes And Apostrophes In SQL Statements

Dec 4, 2014

I'm having problems with quotation marks in a sql statement. The string is an array separated by a semicolon.

120/80;70;5'6";125

this string represents patient vitals. I'm using the string to update a record. But I get hung up with the quotation mark.

I've tried: 120/80;70;5''6'"';125 which is a enclosing the quotation mark with apostrophies, but this does not seem to work. The sql still gets hung up. My sql statment looks something like:

original string: 120/80;70;5'6";125

strPreOpVits = "120/80;70;5''6'"';125"

mysql = "UPDATE mytable SET PreOpVits = '" & strPreOpVits & "' " & _
"WHERE nID = " & myRecID

docmd.runsql mysql

I've narrowed it down to the quotation marks and I'm unsure how to handle these. I get a runtime 3075 - Syntax Error.

Here is the code that I use to convert the original string

Public Function FixQuotesInSql(strToFix As String)
Dim lgth, y As Long
Dim strTemp, char2Add As Variant
'This routine fixes the use of apostrophe and quotation marks in an SQL sequence
'If the apostrophe is at the beginning or end of the string it replaces with 3 x "'" or "'''"
'If in the middle of the string then replaces with 2 x "'" or "''"

[Code] ....

View 7 Replies View Related

Modules & VBA :: Access 2010 File Dialog Box

Feb 11, 2015

I have the following code which successfully opens the dialog box with filters however when I add a function with an Excel import, the filters do not work at all (no files are shown even though they exist in the directory that's opened within the dialog box). If I manually type in the filter (i.e. *.x) it still shows the files.The function at the bottom was provided by cheekybuddha from another form, I'd be lost on getting the Excel file imported into Access.Here's the VBA code (the Function is also included at bottom):

Code:
Private Sub Command0_Click()
On Error GoTo PROC_ERR
Dim strpathtofile As String
Dim strTable As String, strBrowseMsg As String
Dim strFilter As String, strInitialDirectory As String
Dim blnHasFieldNames As Boolean

[code]...

View 2 Replies View Related

Modules & VBA :: Cannot Copy Charts In Access 2010

Mar 17, 2014

I have an application in Access 2003. It uses VBA to open an Excel file. The file has one tab for charts and one for data. The program counts how many charts needs to be created, one per project. It then will place 4 charts per tab, creating as many chart tabs as necessary, keep one data tab. The program then writes the data and links the data to the corresponding chart. It will also write legends, and scale the charts. This all works fine under Access 2003/Excel 2003.The error I get is "Application-defined error or object defined error".The line that gives me the error is: Set chCopy = xlsheet.ChartObjects(idx).I am using the Multi-Chart option frmChartType = 1

Now I'm moving to the Office 2010 world. It is not working. Below is the code I run to do the magic. I guess something is happening in Excel 2010 that is different from 2003.I found when I comment out the error line, and other lines dependent on chCopy it creates the charts, but all the charts are pictures and not charts!!

Code:
Public Sub GenerateChart()
' Generate an Excel chart
Dim db As Database
Dim rst As DAO.Recordset
Dim xlapp As Object

[code]...

View 2 Replies View Related

Modules & VBA :: Sending Email From MS Access 2010

Oct 1, 2013

I would like to update the following code I have been using to send emails, from Access 2010 via Outlook 2010, to include my signature block with hard returns in between each line and a few above the signature.

Lets say the signature would be:
My Name
My Company Name
My phone number
My Reference

I tried next to: stMessage = Me![EmailMessage] &"My Name" & Chr(10) & Chr(13) & "My Company Name"

etc.

It does not work..

Here is the coding :

Code:
Private Sub SendEmail_Click()
On Error GoTo ProcErr
Dim stLinkCriteria As String

[Code]....

View 5 Replies View Related

Modules & VBA :: Creating Shapes In PPT From Access 2010

Nov 26, 2013

Here is my project: For a duty plan the employees are assigned to positions in a certain area.

For example:
Name. Position. Description. Map
Brown. 1. backdoor. 1
Miller. 3. frontdoor. 1
Norman. 4. left wing. 2
Hoover. 6. right door. 2
....

Now I want to show the positions within circles on the maps, with the names within dynamically, as the employees change every week.

The coordinates of the positions do not change, but not every position is needed in every duty plan.

So, my idea is to draw all possible shapes on all possible maps and make them visible or not depending on the assignement.

The duty plan is my table in access and looping through all records I would like to fill the needed shapes.

All maps are on slides (40 slides and about 400 positions) and should be filled accordingly.

I can open my presentation, although I only could do it by late binding ( a reference to ppt 14 obj. Lib fails with an error!! - why??) but I cannot any solution how to loop through the records and do the job.

View 2 Replies View Related

Modules & VBA :: Adding New Record In Access 2010

May 16, 2015

I want to enable a few fields when i click on the Add button on my form.I have change the onclick to Event Procedure to be able to add the following code

Code:
Category_Desc.Enabled = True

My Category_Desc field get enable as expected but the Add button no long work

Code:
Private Sub add_Click()
Category_Desc.Enabled = True
Me.Refresh
End Sub

View 1 Replies View Related

Is Access 2010 Performance Based On Records In A Table Or File Size

Jun 29, 2014

I have an Access 2010 database .. and will be adding about 25,000 records a day to it. So it will get pretty big fast .. so 9 million a year. Is this too big for Access ?? Or is it more a issue of file size .. I know that Access 2010 can go up to 2 GB. I am interested in how I can maximize my performance and not have the database.The data is as follows .. One table. The other tables will be small, just this one will increase in size really.

Id .. Autonumber (primary key)
When .. datetime
Radio .. integer (indexed .. w duplicates)
Group .. integer (indexed .. w duplicates)
Type .. text 4
TransType .. text 2

I am considering a purge of old records if needed .. like only keeping the most previous 5 million records or some reasonable number. Like .. then I would think I should try to number my records backwards (using long int rather than autonumber and number records backwards on import) .. ie record 1 would be the most recent one and only keep the last X number of them for performance reasons.

View 8 Replies View Related

Modules & VBA :: Access 2010 Browse To Shows Only ONE Record?

Dec 11, 2013

The following code browse from one form to another and shows the record details I select in the first form which is what I need, however, the problem is it only shows that record and will not allow me go to next or previous records when pressing NEXT or PREVIOUS by saying this is the First Record or this is the Last Record.

Anyway to modify it to allow me navigate to other records.

Dim txtJobNumber As Integer
Private Sub Job_Number_DblClick(Cancel As Integer)
'Store Job_Number in txtJobNumber variable and display
message to show value.
txtJobNumber = [Job_Number]

[Code] ....

View 2 Replies View Related

Modules & VBA :: Access 2010 - Active Directory Lookup

Jul 20, 2015

I have a database that, I would like to add a button that performs a active directory lookup. I would like it to check a username with Active Directory, and auto populate a few fields.

First Name
Last Name
Manager
Department

This is my first database and I have very little exp using VBA.

View 7 Replies View Related

Modules & VBA :: Adding Y Or N To A Field If It Is Not Null In Access 2010

Dec 18, 2014

how to make this two fields in my form to say Y or N if the field is Not Null. Like if the field is not null = Y Else = N for the two fields. I have a picture to show what i'm talking about.

View 2 Replies View Related

Modules & VBA :: Access 2010 And ADODB Recordset Count

Nov 24, 2013

I opened a 2007 Access db in Access 2010. This DB worked perfectly in Access 2007, but when I opened it in 2010 my recordset.recordcount no longer works.

This is what I have:

rsGetInst was previously defined
Dim intInstCount as integer
Dim rsGetInst As New ADODB.Recordset
rsGetInst.CursorLocation = adUseClient
rsGetInst.CursorType = adOpenDynamic
rsGetInst.LockType = adLockOptimistic

rsGetInst.open "Select * from tblInstruction where CustID = " & intCustomerID
intInstCount = rsGetInst.recordcount

At this point a get a "type Mismatch" error, and it is happening in all my recordsets recordcount.

Is there a command or reference that needs to be change when using Access 2010. When I compared the references the only difference is that in 2007 we reference Microsoft Access 12.0 Object Library and in 2010 is Microsoft Access 14.0 Object Library.

View 1 Replies View Related







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