Hello
I try to print some reports one-by-one using a button .
In the no_data event of each form I've added a message box informing the user that the form will not be printed due to the lack of records. Everything is ok so far. However, after my message box appears and I press ok, a run-time error '2501' occurs informing me that the "openreport action has been cancelled" and promting me to end/debug the vbcode. Is there a way to by-pass this "error" and carry on without having to end/debug the project?
Thank you in advance
Using code on a form to look for a null value for a field on my form. For soem reason this isn't working. I'm checking for a null value in the field on the form. Even if the ClosedDate field is null it still shows the Not null message box. Am I doing something wrong? Thanks
Private Sub Command102_Click() If Me.ClosedDate = Null Then MsgBox "Null" Else MsgBox "Not Null" End If
I have an append query which fails due to validation rules. There are no field validation rules, only enforced table relationships. There is an autonumber field which I am omitting from the INSERT and SELECT clauses in the hopes that it will take its next value.
How do I determine which fields are causing the problem? I have changed the query to a simple SELECT and manually typed in the resulting values with no problems. Note that ALL records I am attempting to add fail the rules.
I found an old post by sbaxter that appears to give me what I need. The problem is that there must be something I am not understanding.
Right now I am getting an "invalid use of null" warning, even though I know that there are values out there.
Everything is on SQL server and I am using an adp file.
The goal is to take the year from the "date received field." and check the table for all records that match. Then get the maximum "Claim_Number_Increment" value from the table. My new increment value will become one higher than that. (I haven't gotten to the point of handling the reset to one when there are no values year - one thing at a time.)
Here's my code, adapted from sbaxter's example:
Code:Dim dtCurrentYear As DateDim s As StringDim intIncrement As IntegerDim db As New ADODB.ConnectionDim rs As New ADODB.RecordsetSet db = CurrentProject.ConnectiondtCurrentYear = Year(Me.txtDateReceived) s = "SELECT MAX(Claim_Number_Increment_I) As 'Increment' FROM dbo.CSF_Claims_T " _ & "WHERE Year(Date_Received_DT) = " & dtCurrentYear Set rs = New ADODB.Recordset rs.Open s, db, adOpenStatic, adLockOptimistic intIncrement = rs.Fields("Increment") Set rs = Nothing Me.txtIncrement = intIncrement + 1
Somehow, it is telling me that I have no values - in reality, I should be getting a 4.
I have developed quite a large database for my company to register complaints on. At certain points, a user may encounter an error when a procedure goes wrong and I want to know if there is a way I can remove the option to debug when it pops up saying End or Debug. Some of the users are using Access Runtime and I know that this will not allow them to debug but for those that are Full version users, I need to prevent this....prying fingers! :-)
I am using Windows 8.1 64 bit system. Into attached access file (OfferStudy.accdb) ,trying to load an activeX TreeView control by defining into a form module. First, I created an empty form and activeX Treeview control.When I define tv variable As TreeView as created in application, it is changing as Dim tv As treeView instead of TreeView. After my code is completed,an error message ("user-defined type not defined") is returning as shown in attached (DebugError.png)file.
I suppose that there is some conflict on creating activeX control on my Access 2013 application.
Can anyone please help me, I currently have a series of queries that are called by a macro, these create a number of tables. But when each query runs it provide a prompt stating what it is doing, my question is can these be stopped so that the queries run without a user being present.
I have a DB that runs an update, delete and append queries and turned off the Confirm prompts under the edit options. The problem is this turns off the confirms for ALL Access applications. Does anyone know how to turn off the confirms only in one specific db rather than the entire access?
This may just be a MS XP thing, but when I open my Database it gives a series of 3 prompts to open the database. The first is a security warning for unsafe expressions, do i want to block them or not, the second is telling me that only MS Jet 4.0 service pack can block the unsafe expressions, do i want to open my database, the third is an actual open, cancel or more info prompt saying code could harm my comp.
how do i get rid of these or at least get it down to only one prompt?
I am having a problem with a database. On one particular computer, a user tries to save data into a current database. The database prompts the user for a password. No password is set on the database. From what I have gathered from searching the internet, it appears that the database would be corrupt, but not so fast. About 20 other people use the same database and have no problems entering data into it without getting a password prompt. Even the same user that is having problems can enter data into the database from another PC, it is only this one PC that it is prompting the user for a password. Has anyone else experienced this problem and what can I do to fix this issue without re-imaging the PC? Thanks.
I have a blank report and dragged two queries to it so that they are displayed on it. Both queries prompt for a Customer code. How do I get it that I only have to type it in once rather than for each query prompt?
I am using several queries with Region Codes coded in the query. My reports are also based on the individual queries and has a Record count statement as well --
=DCount("[State]","Reporting Query1"). All is working fine.
Now to minimize the number of queries I need to write, I want to prompt for the Region code. I can do that [Enter Region Code:]. It prompts and the report shows the expected output (only records for that region code) BUT my count statement ceases to work and I get #Error instead of the number of records. This happens no matter which field I set to prompt.
Just wondering if anyone has come across this problem or might have suggestions for a solution.
I have a Form A that contains a Listbox populated using a query which uses another field on Form A as a parameter for query selection criteria. During the Unload process for this form MS Access pauses to request a value for the parameter instead of exiting from the Form. Why is it so and how can I stop it.
Additional notes - this form worked perfectly in Access97 but this problem is occuring now that I have moved to Access2000. I am running Access2000 on a WinXP platform.
I am basically making a form to streamline the processes and functionality of my database project, so basically it's just a form that runs queries.
However, whenever it runs an action query, it always brings up a yes or no prompt for whatever action it is doing. Is there any way to disable these prompts (i.e. default yes to everything) or is this just an annoyance I will have to deal with?
I have a database with loads of different sales data from Jan 2014 with other product details as well. I also have a form where the user can input any of these data (this is based on a query):
- Campaign name - Exact Date - Month - Year - Category - Campaign Type
This should run the query, then open a report that's grouped by:
1. Year 2. Month 3. Exact Date 4. Dem name
Even if the user inputs the month and year on the form, when reopening the report, it prompts for inputting the year and month as well, but nothing else.
I had created a query that I was attempting to reference a text field in a form that was open when the query is run. It wasn't working and whenever I opened the form it would prompt for the parameter before opening the form.
I ended up deleting the query to try again from scratch. But the form still asks for the parameters whenever I open the form. Why is Access still prompting me for the parameters?
I am relatively new to Access and I was wondering if there is a way to automatically respond to delete table prompts when running a macro.
Currently I am running a macro that takes about 2 hours, and sporatically asks 'are you sure you want to delete table x'. I have to check on it every 10min or so to respond 'yes' or it will pause the macro. Quite a hassle if I am busy with other tasks and forget to check it.
I realise this issue is a common one and it is usually down to simple typos (I've looked at several similar posts) but none of the advice I've seen has solved my problem. I've designed the following Union Query:
SELECT [Email],[Title],[First_Name],[Last_Name],[Company],[Phone],[Country],[TEST_AND_MEASUR],[REC_AND_PROD],[LOG_AND_TRANSC] FROM [Region 1]
UNION ALL SELECT [Email],[Title],[First_Name],[Last_Name],[Company],[Phone],[Country],[TEST_AND_MEASUR],[REC_AND_PROD],[LOG_AND_TRANSC] FROM [Region 2]
UNION ALL SELECT [Email],[Title],[First_Name],[Last_Name],[Company],[Phone],[Country],[TEST_AND_MEASUR],[REC_AND_PROD],[LOG_AND_TRANSC] FROM [Region 3];
It should be very simple and I've checked it over and over, but when I run the query an Enter Parameter dialog appears prompting me to enter Email.
If I just click OK I get all the records but with the email field blank.
Similarly if I type x@y.com it returns all records but with the email fields all containing x@y.com
Advice would be very much appreciated!! Thank you in advance.