All of a sudden none of my queries work properly- all the criteria and calcs i had in them have been deleted?!
Basic codes do not work any more e.g >now() ;between 1 and 30 etc
If i try and write a new query using the same expressions and code they just don't like it - YET they were working yesterday - very strange
Can anyone help??
My Access 2000, created the dummy's way, has been perfectly happy with its query expressions. But when I create a module calling up these queries, I get Compile Error on many perfectly legal expressions such as Left([pfn],1). I've tried repairng the database but to no avail. What is going on, please?
Btw, DBicken, it's when I include your text concantenation code (Posting 6/21/06: "A whole lotta text/stitching") but I don't think it's your fault: it's just exposing it. I can't try your suggestion until I solve this problem.
I have a table that stores the criteria that the query is supposed to pull from so that when a user logs into my database, it reads that the person is part of a sepcific unit and then pulls that specific criteria and places it in a text box on a form. When they click a button on that form, it then opens the form that is connected to the query. The data type for the field I need criteria for is a number, so the criteria that shows up in the text box is this "1 or 3 or 5" so that it shows those specific numbers. If i put that directly into the query, it works just fine, but if I try to connect it from the text box in the form, it gives me a "data mismatch error" or an error explaining that criteria is too vast for access to pull the information. How do I make it read the information in there so that I dont have to create 1000 forms for each different unit.
Example:
Field: Unit Table: Master Log Data Criteria: 1 or 2 or 3
Works fine!
Field: Unit Table: Master Log Data Criteria: [Forms]![Selector]![Criteria]
The text box that is referenced in the criteria in the query says 1 or 2 or 3 and then I get an error... If the information is the same, why does it work when I place it in the query specifically, but not when its in the text box?
I am working on a database that contains patient demographic information. I have a form that prompts the user to enter either the medical record number or part of the patient name. Once you click search it'll then display a 2nd form with a list box outputting the results. Then from there the user can click on one of the entries in the listbox and it'll display the full demographic information on a 3rd form.
Now my problem is on the search part, it completely ignores if I have a medical record number entered. It continues to search by name only.
In my query for med rec # I have
[Forms]![frmSearch]![txtHistn]
where txtHistn is the text box field passing into the query. And for patient name column in the query under OR I have the following:
Like "*" & [forms]![frmSearch]![txtPname] & "*"
So I am confused why it ignores the medical record number entirely.
I have a test database attached. This is just a sample with dummy data entered and not designed pretty. Through this up for another issue I had yesterday that has been resolved but now discovered this query one. The frmSearch is how it begins. If you search by Smith it'll bring up the two Smiths I have entered. If I leave the field blank and enter 1 for the medical record number it treats it as null and displays everything. How can I fix this?
And while on the topic of query, the true database I am working with resides on an Power I series (formerly AS400s) and only linking to their tables. The data is entered in all Caps in the tables. How can I force whatever the user enters into the search screen that it will automatically uppercase the letters before performing the search? Without having the user to remember to enter with their cap locks on.
How does one handle function errors when running a query? Specifically:
(a) I have a user-defined function that lacks any error handling code except for an Exit Function that gets triggered if there is an unacceptable input parameter (e.g. typo in a flag value). (b) This works fine when the function is simply part of VBA code or used in the Immediate window of the VBA editor. However, (c) when the function is used in a SQL Select Query, I get bumped into the de-bugger, and Exit from there does not get me out of the Query. It just gets me out of the current record being processed and then hangs up again on the next.
It seems, therefore, that the function needs to have some instructions that abort the entire query when the function aborts the very first time.
I have an error database that I'm attempting to build. I need the results of the query to show User ID when there are no errors during a defined time frame.
I get the following error when trying to compile code int an MDE: This error is usually associated with compiling a large database into an MDE file. Due to the method used to compile the database, a considerable number of TableID references are created for each table. The Microsoft Jet database engine version 4.0 can only create a maximum of 2048 open TableIDs at one time. Exporting a database as an MDE potentially can exceed this limit if the database has a large number of objects (table, macro, form, report, etc). There is no accurate method to estimate the number of TableIDs the Jet database engine uses during the process of compiling a database as an MDE. However, each VBA module and each form uses one TableID, as a result, if the database has 500 forms, and each form's HasModule property is set to Yes, as many as 1,000 TableIDs are used.
There are only about 10 linked tables to SQL server, a decent amount of code but nothing that bad in the Access FE. Any ideas on how to solve this? As I understand it, the code will run faster when compiled?
I just recieved a access project from a client, apparantly it works fine on their machine. I FTPed it to my machine. Both are winXP.
Most of the app works fine except when I try to bring up one form. I get this error.
Compile Error Can't find Project or Library.
This is written in access 2000 and that is what I am running it on. I've checked windows update, my computer is up to date. That includes Office update.
I tried running this on a second box that I have, a win2000 server I get the same error.
It apprears something is not getting transfered, any Ideas?????
I tried to declare a variable to be type Database and when I compile the program it gives me an error Compile error "Use Defined type not defined" this is the code that I have written:
Public Sub NewX()
Dim mydb As database ******** here is were is giving me the error, I tried to declare this on several places but it does the same error********** Dim myrecord As Recordset
Set mydb = CurrentDb Set myrecord = mydb.openrecordset("log", dbopendynaset)
the rest of the code continues....... End Sub
Any help will be appreciated, I am trying to save the information on the database by clicking a coomand button .
I used "Option Explicit" at the beginning of a module. When I compiled the code, I received a Compile error that indicated the Set dbs = CurrentDb is not defined.
hello to the experts is there any way or method to compile an access .mdb file to .exe and don't be the need to open it with the access programm? (eg. to a computer wirh no access installed)
Does anyone happen to know to compile the different results obtained by passing a query a series of parameters?Say i have a query that returns the total work hours for an employee for a month, and the employee's name is passed to that query as a parameter.And i want to compile the data for all the employees (in a report or query) where the list of employee names to be passed are stored in another query.Just using Access 2000 with some VBA.Thanks for any help :)
I made a copy of my database named Stores and named it as Purchasing.I did this as they are basically identical except Purchasing has some other tables, forms, etc..When I click on the Debug/ Compile it says Compile Stores, is there a way to change this so it says Compile Purchasing.Without having to create a new database and import everything.
When trying to open an Access database on the server, an error message appears - "Compile of hidden files error", followed then by a run-time error. There is no problem accessing the the server and opening the database from another PC? Does anyone have any ideas what could be causing this. Backups to CD have started failing at the same time.
I am the secretary of an athletics club and have the task of using membership data to compile groups of athletes.:eek: One of the fields that I have available is the date of birth of every athlete. It is entered in the form dd/mm/yyyy. I would like to be able to query the database and display the age of each athlete.
I would also like to be able to query the database so that I can compile groups of athletes grouped by their ages as at 01/09/yyyy These groups would be: Under 11 years, over 10 years but under 13 years, over 12 years but under 15 years, over 14 years but under 17 years under 20 years. over 19 years. I have some understanding of using SQL view in Access but my overall knowledge must be viewed as "novice". If you are able to help me with this problem I would be extremely grateful (as would our club), and I would also be obliged if you could keep instructions simple. Many thanks John:)
I have an unbound list box that updates the data displayed on the form when a selection is made from the list.
Private Sub List13_AfterUpdate() ' Find the record that matches the control. Dim R As Recordset Set R = Me.RecordsetClone R.FindFirst "[HospitalID] = & '" & Me![List13] & _ "'" Me.Bookmark = R.Bookmark Me![List13].Requery End Sub
I am having problems with this no longer working once I import the database objects into a secured database. I am encountering an error "Compile Error: Method or data member not found" with reference to the list box in the "findfirst" statement. I have tried this many times before and after the security and the results are consistent. I was otherwise ready to go with this new database. Any insight would be appreciated as always. Thanks.
every month i compile a Customer Spend Report for my sales manager.
I currently do this by:
1) Taking my database into table view. 2) Setting the date to Asend. 3) Then copy all jobs from the first day of the month to the last day eg: June 1st - 29th. 4) Copy the data 5) paste into excel 6) Set auto filter on excel 7) Copy & Paste each customers spend to an individual sheet.
This is very painful! Esp when i know that since all the data i need is in the database and there is a way to get my DB to do this for me.
I have created a query to pull the data out of the database. Then made a report using the query as the "location of data"
Right i have the report now pulling out the data and showin how i want it.
It shows the groupin of jobs by "Customer Name"
I now want to set a filter to it so that i can tell it to give me the report for all customers for just one month.
EG: June 07.
That way i wil have the data shown as:
Customer: Month: June07 Cost For Doin Job: Total Charge Out: Profit:
How do i do this??? I know it has to be done within the query but i cant work out how to set it.
whatever Microsoft office program is open. The problem i get is that when i add the reference Microsoft outlook 14.0 object library i get a compile error "ByRef argument type mismatch".
Code:
Option Compare Database Public Enum OfficeAppName Outlook = 1 PowerPoint = 2 excel = 3 Word = 4 Publisher = 5 Access = 6 End Enum
A receive a compile error when an OpenForm macro action is executed. The error message is: The form you referenced may be closed or may not exist in the database. Microsoft Access may have encountered a compile error in a Visual Basic module for the form.
I have developed a quote form that is working well. I want to print out a Quotation to send to my customer. Currently it shows the Qty, Item ID# and description in the detail portion of report. In the report footer, currently it will print out, Subtotal, Freight and the resulting total.
A problem arose when I tried to add the total weight of the items in a quote to the report form. I get a "compile error...variable undefined" msg when I try to open up the report by clicking a "Print Report" button I have on the form.Here is the code that is highlighted by the error msg. the Undefined variable is dWtTotal n red below.
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer) Me!txtSubTotal = dSubTotal Me!txtDiscountValue = dDiscVal Me!txtTotal = dTotal Me.txtFreight = dFreight ' Me!txtTotalWithWork = dWithWork '12-21-14 Add Total Job Wt to Report Me.txtWttotal = dWtTotal
I feel like I have defined the variable with this code below which is in the first part of the VBC code that occurs when I click on the Print Quote button: