I'm simply trying to copy a group of cells I've got selected in a separate workbook to the existing sheet.This chunk of code works when I'm testing it in 2 sheets that are in the same file
Code:
Selection.Copy
With Sheets("testdump").Range("B" & y).End(xlToLeft).Offset(, 1)
.PasteSpecial xlPasteFormats, Transpose:=True
.PasteSpecial xlPasteValues, Transpose:=True
End With
I need to make it work while I'm pointing to a different file. This Errors Out
Code:
Dim appXL As Excel.Application
Dim wbk As Excel.Workbook
Set appXL = New Excel.Application
Set wbk = appXL.Workbooks.Open(GrabIt)
[code]...
The application.copy works. I don't know how to structure the 'Pastespecial'. I've used the code to reference other workbooks many times. I'm actually editing in a code that was working for a slightly different application. The sheet I want the information in is open and selected. The sheet it's coming from is open in an instantiated instance.
I have designed a couple of DB's using Access 2002 in Access 2000 format. While these all work perfectly in Access 2002 there a few users still using Access 2000 and are experiencing errors (specifically with Graph.exe which is 10.0 in 2002 and 9.0 in 2000 and also with the Calendar Control which is 10.0 in 2002 and 9.0 in 2000).
Is there a way to use the 2002 versions of these controls in 2000 or do I have to create the DB using the Access 2000 versions (in which case would I need to design the DB in Access 2000 instead of 2002).
Can anyone suggest anything or point me in the right direction.
Anyone seen this before? The scenario is - A distributed application on ten machines - all running the MDE in runtime. All machines are running perfectly. Minor changes made to the application and new MDE built. After roll-out, six machines work perfectly with the new version. The remaining four run the application but experience the dreaded "#Name" in various places. Revert back to the previous version - and all run perfectly again. Cannot be missing files - have not called for any and previous version works. Cannot be broken references - six are running OK. Cannot investigate on any of the machines because they are running MDEs. ??
Is it possible to set which VBA reference boxes are ticked each time a database is loaded?
A problem is created when a person amending the database to the person using it has different setups and so some of the references show as "missing" and so compile errors show on loading.
Iīm having problems with the datevalue function. Now I know the date function sometimes malfunctions due to a references problem, so I'm thinking maybe this is the same thing. However, there are no missing references.
I tried searching the forum, but couldnīt find the answer.
Hi guys, ive been developing a database for someone. As some coding has been involved, I have added some references etc as I went along.
I'll be soon handing it over to them to use - will they have to add the references for the database to run on their comp? If so, is there more user friendly way of doing it than going into the VB bit etc?
I have a database with a form. The form has quite a bit of code. This database is on a network. On some of the computers the Form will not open. When I go into Microsoft Visual Basic Tools References I am finding the following.
MISSING: Microsoft CDO 1.21 Library MISSING: Microsfot ActiveX Data Objects 2.1 Library
I have created a list box that acts as search criteria. It has 4 columns, SerialNo, Company, System, Processor. I need to reference these columns in VB with a sql statement that basically says:
Select * from SystemInfo Where SerialNo = listboxSerialNo and Company = listboxCompany and System = listboxSystem and Processor = listboxProcessor
My question is how do I refer to each of the columns in the listbox in my where statement? The listbox has the name, 'lstcriteria'. I can use just that in the reference and it will use the serialno only. How do I parse out each of the columns?
I have an Access DB, which keeps having a problem with resources. When I go in and refresh the resource, it works fine.. For a while then same problem comes up again.
I've had to refresh the references several times this week. Is this down to a bigger problem?
Love this forum! It orginally helped me build a database to manage customers back in 2002 (using Access 2002). Becuase of our slow server, I was forced to spilt the database and it's been great for years (some glitches). Recently one of the users upgraded to Access 2003. When he sync's to the master file, the master has problems. "...contains a missing or broken reference to the file 'OWC10.DLL' version 1.1" I reviewed the references and it's looking for Microsoft Outlook 11, instead of 10. When other users sync, everyone now inherits this problem. Do you have any ideas for a solution so I don't have to fix reference problems? All users will eventually be on Access 2003 so having him stop using it would only be a temporary solution. Is there a patch or upgrade to fix this problem? Any help? thanks in advance....
How can I get my form filed to return the results of a query that I have? For example I have my query set to use the month and year that are in my form in a cbo to get the desired results for Balance Growth. I want this Balance Growth result to show in my form field after the year is updated in my cbo. Right now in my Balance growth field on my form I have it linked to the query but it has the #Name? in it. Thanks for any help.
I am using vba code to create a new MS Access 2002 database and copy the current database tables, forms,etc into it. The problem I have is there are several references that I need that are not set in the new database I created. One of them is the DAO reference. My question is, is there a way that when I copy the DB the references from one will be copied to the other? or is there a way to set the preference and priority using VBA?, DAO needs to be higher up on the list inorder to work.
I use the following code to create a new db Dim cat As New ADOX.Catalog cat.Create ("provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & sName & ";")
I then use the transferdatabase command to copy the tables, forms, etc to the new database
is there a different way to copy the current db into a new db that will include the references
I also can add a reference using the following code Set ref = References.AddFromFile(spath) AddReference = true
i have 20 odd machines sharing the one access front end, however i find that i have to recompile the front end on some machines as the references dont match up. i'm assuming the office install is slightly different with the paths or something. there are just 3 machines that have this error but it is frustrating as i have to recompile and have 3 different copies of the one program.
is it possible to have all of my references stored on the server and they replace the current ones? i tried putting them in a folder and using the browse button but it only updated some references and not others. the obvious error i have with the 3 different ones is the trim function, it always throws an error where i use that.
i am having issues with certain users re references, I get weird errors when sending emails through Outlook, is there anyway running some code for me to check a users references?the below is what i have and everything works fine, so would like to check they have these
Visual Basic For Applications Microsoft Access 14.0 Object Libary OLE Automation Microsoft Outlook 14.0 Object Libary Microsoft Office 14.0 Access Database Engine Object Microsoft Office 14.0 Object Libary Mictosoft ActiveX Data Objects 2.5 Libary Microsoft Excel 14.0 Object Libery Microsoft visual Basic for Applications Extensibility 5.3 Redemption Outlook and MAPI Com Libary Windows Script Host Object Model
I am cleaning up a database that has been around for some time and I wish to be able to check for references within REPORTS/VBA Module code/ Form Designs etc. anywhere there is likely to be a reference to either an Access TABLE or QUERY.... I know there is the 'Object Dependencies' function within Access that will go some way to telling you what relies on what, but this is simply not comprehensive enough in that it doesn't go down to Form design level where further references can hide...
Countless times I have checked and subsequently deleted tables that I considered redundant... only to find later on there was some SQL Source reference to a table or query buried in the design of a form that I had overlooked....
Any way to definitively check and to ensure that all traces of a specific table or query are accounted for...?
I am trying to create a database which crosschecks specifications against building codes. My problem is that it's not feasable to put all of the information about a Building into the Room table, though many codes require information about the Building in order to classify the room. How would I count (or list/get details from) a room in the Rooms table, for use in an SQL statement about the Buildings table.If there are up to 5 rooms in the building, do at least 2 rooms contain a fire escape?
My Rooms table contains information about if the room has a fire escape, as well as references its parent Building ID. How would I query the rooms to count the Rooms within all buildings, and subsequently query all Buildings which have less than 2 rooms with fire escapes?I need it to return a list of the buildings which do not conform to this code.
Now this is literally my second day of programming/working with Access, but I've yet to find an answer dispite hours of searching.I think I can adapt it for the 100+ building codes/references I'll need to implement. It would be perfect to find an SQL-only way of doing this, without going into modules etc...
I have a database with forms that use ADO to access data files. In the design stage, I went into Tools/References and checked "Microsoft ActiveX Data Objects 2.1 Library", which made the ADO work.
For each "case" that is run, the application creates a separate database and copies all forms, reports, etc into it. In Access 2003, the forms in the new database still have "Microsoft ActiveX Data Objects 2.1 Library" checked, but when I run the application in Access 2007, the forms do not have "Microsoft ActiveX Data Objects 2.1 Library" checked, and the ADO will not work until I go in and manually check it myself.
Is there a way to select the ADO objects programatically or to keep ADO set as a default property in Access 2007? Thanks so much.
I cannot get this code to run in access 2010. It shows no missing references, but errors that Object required.
Dim wshShell, btn Set wshShell = WSCript.CreateObject("WScript.Shell") btn = wshShell.PopUp("Filter data wil be removed.", 2, "Data Unfilter:", &H4 + &H20) Select Case btn
I have a database I took over, that generally uses linked tables to a MYSQL servers on another machine. The Access database uses a machine DSN to connect.
There are many queries that contain references to linked tables using another name. For example, the table is "service unit" but the queries are using "SU" as a reference. I cannot find any database object with that name SU. There are many such tables referenced like this - all uppercase letters, which is a common thing they all share.
Now, the server had a file integrity issue, and now the queries that contained the SU references will not work anymore. I created a linked table and called it SU and but the queries still won't work until I edit the queries, remove the old SU table, and add the new one in. So,
1. Where those table references could have come from, if it's not a linked table? Is there a hidden location on the server, or in the access database that stores another connection method?
2. Why won't simply adding a similarly named database object work the same way? Why must I re-edit all the queries?
I have someone using my database as an mde, using the 2003 runtime, on a computer that has XP with Office 2007 (including Access 2007). Eveything works fine, except they get error 3085 on a line of code that is running an Insert SQL statement.
What is weird is that the SQL statement does not include the nz function. It does include a simple UDF for rounding, but that UDF doesn't return an error.
I also have code that checks the references on startup, and none of them are coming up as missing or broken. I have also double checked each reference and they have the exact same version number of every reference (dao360.dll, mscomctl.ocx, etc.). So if it is a "diambiguation" issue, I don't know how to fix it, or even identify it.
The code runs on several other computers with various combinations of XP, Vista, Office 2003, and Office 2007 with no problems.
I am stumped. What else could cause this error? Even if you don't really know, but you have a vague idea, please post it because I can't even think of anything else to investigate at this point.:confused:
I have a table called Tbl_Query_List that houses the query names that I want to be displayed on a continuos form. I want the user to select the query by highlighting it in the continious form and then having a command button at the bottom of the form.
I have everything setup including the command button. Assuming that on the EVENTS tab I set the OnClick to [Event Procedure] but when I click on the ellipsis what do I type to make it run the highlighted query?
I'm quite new to Access and have inherited a database from a colleague. It is a database of references from which we have extracted pesticide active ingredient, pest species and crop species using forms. I am trying to create a query that will allow us to search and return unique active ingredient x pest x crop species combinations (but which will return all instances of this combination).
The complication is that the pest and crop species names are within the same field ('taxa'). They are distinguished by a label ('pest' or 'crop') in an associated field ('PestorPredator'), but a query using 'OR' will only return a crop OR pest, whilst a query using 'AND' will return no records (because something can't be a pest AND and crop).
I want to be able to create a table that shows the active ingredient, associated pest species AND the associated crop species each in separate columns. We have tried a couple of methods, including UNION and UNION ALL....
find a way to automatically copy data from an access query to a sheet in excel at the end of every month we record financial data from our database into an excel sheet for our accountants. im still designing the query to format the data exactly the way we need it, which is why im not too clear on all the details (have a meeting with the accountants on wednesday to confirm everything, but im hoping to get most of the function written by then at least)
Ive already got the pathfilename and worksheet name stored in variables (excelFile and workSheet respectively) and ive worked out a way to store the row number (in a variable called simply rowNum), i just need to add one record to that specific row, from columns B to I) and for now lets just assume the query would be qryFinancialData. simple way to export the data, ill be formatting the query so that the first field in the query will go into column B, second field will be C, third field will be D, etc.is there a quick way to open the file, add the data to the right columns/row and close/save the excel file, all through VBA?