I am not sure whether this is a problem with MS Access, Visual Basic or Windows.
I have taken over supporting & developing an MS Access 2000 DB for a small charity & am not an Access expert or a programmer. The Application includes processing to create, amend & store retrieve standard letters based on a Word document called MyMerge.doc. The operating systems is Windows XP for the PCs with a MS Server 2003.
Each letter is allocated a number ‘CallID’ which is used to retrieve the letters later. The letter text is in MessageC.
The VB code to store the letters (Save As) is
Dim strTest As String, db As DAO.Database
Dim td As DAO.TableDef
Set db = CurrentDb
For Each td In db.TableDefs
If Len(td.Connect) > 0 Then MessageE = Mid(Left(td.Connect, InStrRev(td.Connect, "") - 1), 11)
GoTo jumpout
Next
jumpout:
MessageC = "%fa" & MessageE & "Db Letters" & MessageC & " " & (CStr(Forms!Contacts![PostalCode])) & " " & Trim(DLookup("[TitleType]", "Title Types", "[TitleTypeID] = Forms!Contacts![TitleTypeID]") & " " & Forms!Contacts![FirstName] & " " & Forms!Contacts![LastName])
objWord.Application.Activate
SendKeys MessageC
The VB code to retrieve the letters is
Dim MessageE As String, db As DAO.Database
Dim td As DAO.TableDef
Set db = CurrentDb
For Each td In db.TableDefs
If Len(td.Connect) > 0 Then MessageE = Mid(Left(td.Connect, InStrRev(td.Connect, "") - 1), 11)
GoTo jumpout
Next
jumpout:
Dim WordApp As Word.Application
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = True
WordApp.Application.Activate
MessageE = "%fo" & MessageE & "Db Letters*" & CallID & "*.doc"
SendKeys MessageE
Set WordApp = Nothing
GoTo Exit_Command53_Click
The success rate varies from PC to PC and user to user. It will work with one letter and not the next. It is very difficult to identify a pattern. When the Save As does not offer the expected name & path, the Application (or operating system?) offers to save ‘MyMerge’ to the user’s My Documents folder.
In that case I tell the users to correct the path themselves and save the document under the CallID. Theoretically, retrieval should work since this uses the CallID and wild cards. Sometimes it does but often it will instead retrieve a document in the user’s My Documents folder. If it does go to the right folder, you sometimes have to replace the last wild card with ‘.doc’. I have tried replacing the last wild card in the VB code with ‘.doc’ but this does not work!
Finally, I alone get the message ‘Save failed due to out of memory or disk space’, neither of which is true. This makes it very difficult to continue investigating the problem. If I use a copy of the DB on my hard drive rather than the network I can save but not retrieve.
I am trying to build a database for my digital photo collection. (having pretty much gven up on the packages I see in the market)
Since most of the images reside on CD's and DVD's, I want to create and store thumbnails and pointers (ie. location fully qualified name), rather than a copy of the full image.
1. How do I define the fields in the table for the thumbnail, and the pointer? 2. How can I use the pointer value to retrieve the full image?
I'm designing a database in which the primary key is a combination of the first letter of first name, the first letter of last name and the date of birth.
ok here is what i want.. imagine a search box, just an empty text box that allows the user to type things into it...
there will be a simple table from the database behind it, here is the typical structure of a record
<Country>Poland <Price1>60 <Price2>85 <Price3>95
in this table there will be say a 1000 of these records... my user is going to have to quickly search through these records while on the phone to a customer, and quote one of the relevant prices associated with that country
what i would like is this most convenient system.. as the user types in the letter 'P' just below all the records with countries that begin with 'P' are displayed (with a scroll down arrow if needed)..as well as the 3 relevant prices with that record
if they then type an 'O' into the box (which will now hold 'Po') all the records with countries beginin with 'Po' will be displayed (eg Poland)
if they delete the 'o'. once again the displayed records below the box will return to just the countries begginin with 'p'
all that is needed is for the records to be displayed, thats it.. but the adding and deleting of the letters within the text search box will need to instantly manipulate this list..
i have posted on other forums, and have been told this can be acheived in access, is it hard?
I want to retrieve data from 2 columns using only 1 search option. At the moment I have 2 ID fields which contain various numbers. My data retrieval functionality only retrieves data on either one column or the other using 2 search buttons. So for example, if they want to retrieve data on ID column1 they have to click the button named this and if they want to retrieve data on ID column2 they have another button for this. What I want to do is when the user clicks the button I want access to prompt them for an ID number (only want 1 prompt). Once the ID number is input I want access to search both columns for the ID number and return it. Any ideas on how this can be achieved plz?
I'm very confused. I have two tables in my db that should be the same except for columns(I copied one table from the other). In each I have a "default" entry as the first record in the table just to prevent my select queries from erroring out if they don't find a match for the criteria. When I use the following statement, Code:SQL="SELECT ID, Name, Picture FROM background WHERE Name ='" & Fname & "' OR Name='Default'" it returns the default value as the record, not the match for "Name", even though there is one(when I remove the OR Name='Default' it pulls the record).
When I use this query for the other table from the same .asp page, Code:SQL="SELECT ID, Date_Time, URL, Icon, Title, Description, Status FROM Submission WHERE Technician ='" & Fname & "' OR Technician='Default'" it returns the record where "Technician" matches even though it is below "default" in the table.
I want the query to return the "default" record only if there is NO match for the first criteria, which it does in the second case, but not the first. Is there some way to force this? Thanks in advance for any assistance provided! -Chris Gordon
I am trying to run a Query that searches for a single Tool ID Number and returns the transaction record that has the latest date. My query currently is this:
SELECT LocationStatus.ToolID, LocationStatus.CurrentLocation, LocationStatus.DateofEvent FROM LocationStatus WHERE (((LocationStatus.DateofEvent)=(SELECT MAX(dateofevent) FROM [LocationStatus] AS t2 WHERE t2.[ToolID] = [Tool Number])));
But the problem I am having is that the query is returning MULTIPLE Tool ID numbers with matching dates. Before the query runs a parameter box pops up asking for a Tool ID number but there should only be one record returning. HELP!!!:confused::confused:
Why I getting an error when trying to run the below code ? If I take out
Me.ClientNameList.Column(1) = rs.Fields("[Tracking Date]") Then . . .
add "And" to
If Me.ClientNameList = rs.Fields("[Client Name]") . . .
I do get a record, but with the wrong date. I need to match the client's name and tracking date, then move the related fields to a MS Access form.
The code follows:
Private Sub ClientNameList_Click() Dim db As Database Dim rs As Recordset Dim i As Integer Set db = CurrentDb Set rs = db.OpenRecordset("Progress Tracking")
Our organization (a University) has been engaged in becoming "paperless."
As part of that initiative, we have spent the past several months scanning several hundred thousand pages of documents relating to building systems (HVAC, e.g.) as well a a massive quantity of detailed lead and asbestos surveys and abatement records.
The initiative is indeed reducing the quanity of paper stored in binders and file cabinets, however now it is becomming evident that retrieving some of that information is a real problem for some folks.
At a meeting this morning a question arose about whether we could develop an Access application to retrieve the documents (which are very logically filed on a network share, but it seems to be beyond the compreshension of some staff how to actually navigate through the maze).
My question is this: has anyone in this forum ever tried to implement such a solution with Access?
Any advice or insight would be very much appreciated.
I build the WHERE clause in my form's record source dynamically, depending on the context in which the user opens the form. I can't put the WHERE predicates in the record source and refer to fields on another form, as the context will determine which predicates are required. So I have code like this:
Public gf_FormInstance As Form Dim strSelect as String : Set gf_FormInstance = New Form_F_PerformanceSummary : gf_FormInstance.RecordSource = strSelect gf_FormInstance.Refresh gf_FormInstance.Visible = True
The problem is, the Set statement causes the New form instance to retrieve all records from the existing record source, slowing down the performance.
I'd like to find a trick to suppress the retrieval of records when the Set statement executes, and then allow them to retrieve when the Refresh statement executes.
I have an entry Form which is used to record prospective new members of a society in a Table named 'Foreigners' in a Membership Database using Access 2010. The entry form also records the name of the 'Interest Group' to which the prospective member is initially affiliated.
On entering this Group Name, selected from a drop down list from the Groups Table, The Group ID & Leader Member ID are automatically recorded.
However, I don't wish to record the Leader Member ID, what I wish to record is the Leader's Member Name which is identified by that ID in the related 'Mail List' Table.
In the Properties sheet the relevant source for this field is shown as Leader, but what is displayed is the Leader ID...
(this is a repost ) I will skip the basic intro of "Hi im new to access and i dont know.." anyways, what I am trying to search for and I dont know what Im looking for is this.
Q1) I would like to be able to open a zip file, read the NFO/txt file from within and import certain areas of the NFO file,the NFO file of course is layed out with ascii art but there is a predetermined area where certain info is obtained. for example: I would like to capture/import the URL, testers name, date avaliable, zip file name.THEN the text imported would be written to the database. It would be nice to figure out how you go about importing certain lines but im not sure how to ask the question and find the answer the right way. ie...(ascii art found here http://www.ascii-art.de/) -= I did search import text and get text and didnt find what I was looking for=-
Q2) How do I write to an ascii file/nfo/txt using access, there is a template or a layout that is pre done,and i need certain fields filled out, just like they above layout.
thanks for all your help, you guys are awsome, and keep up the good work!
I'm new to Access and was wondering what the storage capacity was for a table.
I am presently working with a table that's approx. 70 columns and about 6,000 rows (and growing). Does anyone know at what point I'll be hitting a wall? It's already too big for me to import into Excel (which is another problem).
I found this page (http://support.microsoft.com/kb/824263) as a pretty good reference for field data types, but there's some things I still want to know.
What's the per-character storage on a Memo and Hyperlink field (ignoring compression)? Are AutoNumber types (Long, Replication ID) unsigned? Do null [non-text] fields still use their full capacity?
I am using a table that stores data and one of the fields is just a text field with a maximum length of 10.
However, when I store the data in the field, if I only enter 5 letters in it, it stores the 5 letter word correctly but followed by some spaces (I assume 5 spaces but I may be wrong.
I cannot figure out why does anyone know why?
If not, then can I trim the field if I use it in a query/report?
Hi My database is to have a Personnel data area whereby I can store all relevant details for employees within the company. I plan to incorporate a feature whereby I can alos maintain a history of documentation written and issued including links to the actual documents for that employee during their time with the company.
Has anyone done a similar thing they would be willing to allow me to use? I figure this would contain links to work documents stored on the hard drive in a specific folder. Selection of a specific item from a historical list - would invoike Word /similar and display the appropriate file...
Any ideas would be gratefully received. Thank you.
got a wee problem... i have a number of graphs showing volume (x axis) and pressure (y axis) for particular pipe sizes.... (it's for pneumatic conveying)
depending on the resolution of the hand drawn graph there could be 100's of points along a single graph line (x and y points)....
My program basically needs to select a point(x and y) closest to the graph line that it intersects. (come on mech. engineers)
Problem is how should i store / input the graphs into the db file?
I'm trying to avoid have to literally input every x 'n y point per line per graph... there are about 20 lines per graph and a 100 odd graphs!!!
I was thinking of inputing a start and end point then use some sort of formulae to draw a logical line and pick up all the xy points i need, then store them...
i am busy with creating a access storage database and need to calculate the number of days a vehicle is in storage, i have a [date in] field and a [date out] field. i need to calculate if [date out] is empty to use today otherwise [date out] - [date in]
What I have now is an excel template (with ~12 worksheets) that many regional offices use to enter in some lease data, from which the excel sheet creates a rental schedule and does a whole ton of calculations on that data. Some are NPV calculations, some are yields etc etc.Eventually, I would like to:
1) Enable users to fill out one of these templates, and save the data to the database (Just the inputs? All the data? My reading suggests just the inputs) 2) Use the database to produce one of these templates for any lease in our system (shouldn't be hard, from what I've read) 3) Sum up calculations from this template for many records (eg. if a tenant has many leases, what is the NPV of all of those leases, or what is the total NPV for all tenants)
I have the inputs (from Access) I will have no problem using them in the excel version, but does it make sense to use Access given that I may need to somehow be switching back and forth to get the info I want for my various reports? I am very comfortable writing macros in VBA for excel, so if that's the solution, that is no problem. I assume what I need for #1 and #2 is a macro to arrange the inputs from the excel sheet into a format that can easily be dropped into access tables and vice versa.
I have a VBA program which is stored in an Access database. The program creates letters using Word template documents as well as new Excel sheets. When one of the users in my team undertakes this process she is unable to create the files (although she could before). The following error message occurs initially for the word documents:
"The document could not be registered word 2010. It will not be possible to create links from other documents to the document"
When I enter debug and attempt to run the code again the file opens but subroutine halts again and I get a different message:
"Could not open Macro storage"
The line of code which is identified for both errors is:
Set wdDoc = wdApp.Documents.Open(TemplateLocation)
Where wdDoc is the a Word.Document, wdApp is a Word.Application and TemplateLocation is the path for the template
I have already checked the following:
- 'Trust access to the VBA project object model' in the Trust centre is ticked and Macro Security is set to none. - DCOM Server Process Launcher is set to automatic in Services (Local)
I have a table with inventory items, a separate table with storage charges per day (ex .03, .04, .05 per day/per item)
I have created some queries where I take the items & # of days they have been in storage and when I try and create an expression for storage charges based upon QTY & # of days I am getting results like it is multiplying whole numbers and not very small increments like .03
I have checked the math, and its not multiplying by 3 instead of .03... I cant quite figure out how it is coming up with the numbers.
Again, the pricing is coming from a lookup wizard to another table. It seems like it should be a very straight forward expression but I cannot get it to work. Does the figures being from a lookup have any issues?
I have this database with the purpose to storage all the tasks that are done in my team. I have a table named Tasks with all their fields. Now, I would like to set a more user friendly way for clients to update this table. I have created another table with a list of most common tasks, so when a client wants to add their tasks list they can choose one of this tasks and add it to the list. I had created a form with multiple items that contains the common tasks and next to each task a button that adds the information they choose into the table "Tasks". This works just fine. However, I would like to add a single button at the top to add all the tasks instead of having to choose one after one.
The "Add All tasks" button has this code:
Private Sub Command79_Click() Dim valSelect As Variant, MyDB As DAO.Database, MyRS As DAO.Recordset Set MyDB = CurrentDb() Set MyRS = MyDB.OpenRecordset("Tasks", dbOpenDynaset)