Modules & VBA :: Database Quits For No Apparent Reason
Jul 15, 2014
I'm having a weird problem in VBA on a button click. For no apparent reason the database closes itself. No error, no crash - it just closes. I've compacted and repaired it, recompiled it, but still exactly the same. The strange thing is, if I insert a blank message box at the point in the code where it quits, everything then works perfectly!
Also, if you leave Text4 empty so that it displays the message box telling you to enter a code to start, when you then enter something the next time it also works perfectly. Somehow the process of displaying the message box seems to fix whatever the problem is. I've tried pausing the code at that point, I've tried changing the focus to a different control or another form.
Here's the code:
Private Sub cmdReqLookup_Click()
Dim strTaleoReq As String
Dim strTaleoID As String
Dim intIDMatches As Integer
Dim strContractID As String
[Code] .....
'This is where the database quits. If I add a message box here, it then runs perfectly!
'Disable button
Me.cmdReqLookup.Caption = "Please wait..."
Me.cmdReqLookup.ForeColor = vbRed
Me.cmdReqLookup.Enabled = False
Me.Refresh
ScriptHold (1)
[Code] ....
View Replies
ADVERTISEMENT
Aug 2, 2013
I've created a database with multiple subforms within the form; however some of the subforms randomly appear and disappear for no apparent reason.
View 2 Replies
View Related
Mar 26, 2008
I am working on developing a database that develops requests to send to another department. There are a lot of forms, macros, reports and queries. A user inputs information into a form, and then selects a command button that is attached to a macro that builds the request. Midway through the build, another form comes up to complete missing information. I was going along just fine - at the testing stage for this part of the process - when the database stopped working like it should. Some of the issues I am seeing:
1) If you open a new query and try to close it without saving it, it just keeps asking you if you want to save over and over even though you select No.
2) If you open an existing query and make a change, it closes it and saves the changes without any prompting at all.
3) Macros and forms do not work right. I have a macro that deletes the records from one table. The form for that table now shows #Deleted in all the fields instead of blanks.
If you compact/repair the database is good for one run through but then it doesn't work correctly again. I have had this issue in the past but have no clue how I break my databases! I have a general knowledge of Access, I am not really a VBA coder if I can avoid it at all costs. There must be something in the relationship between all my tables, queries, forms, etc but I have no clue even where to start to troubleshoot. HELP!!
View 3 Replies
View Related
Apr 25, 2006
I am developing a system using Access 2000. Occasionally when I click on the save button in a form or a report, Access unexpectedly quits without any messages and without saving the current work.
Any suggestions from any one would be welcome.
View 1 Replies
View Related
Apr 25, 2006
I am developing a system using Access 2000. Occasionally when I click on the save button in a form or a report, Access unexpectedly quits without any messages and without saving the current work.
Any suggestions from any one would be welcome.
View 5 Replies
View Related
Jul 23, 2005
Hi Guys
I want to ask you that what are the main reason that Microsoft Access is not using in large companies. I want to ask you that "Is that true that M-access can,t bear the too much records in one database and it slows down.My friend ask me that if we use backend of sql server and front end of Microsoft Access then what will happen? Is there any chance to increase the performance of Access based software by this method
Anxiously Waiting : Sohaib
View 2 Replies
View Related
Sep 3, 2005
Hi, i have a query which looks at a table named "attendance" the query includes the fields: "employee number", "absent code" (a 3 letter code), "absent reason" (list of different reasons) "shiftdate" (weekly shift dates in format: DD/MM/YYYY). If possible i would like to be able to promt the user to enter a employee number, then a absent reason (ideally from a list box) and show all occurences (with all the shiftdates) only of that particular absent reason within the last 12 months, and ideally calculates in another field the number of times that employee has been absent for that particular reason for the last 12 months.
Does this make sence?, i know how to promt the user to enter a employee number but not sure how to go about the rest, any help with what seems to be quite a challenging task to me would be excellent.
View 4 Replies
View Related
Jun 23, 2006
If I put a calculated control on my form, I don't seem to have any way of pushing its changes to a field when those changes happen. Access can be downright infuriating at times. I've spent days just putting together a simple invoicing application.
My form is not based on a query like the northwind database, because that created such ridiculous and useless behavior with subforms that I couldn't. So now that it is based on a good old fashioned table, when I change a qty or price, the calculated "extended price" (=[qty]*[price]) field visibly changes just fine, but it never has an "after update" or "after change" event. Why would this be? How am I to save these bloody changes to an actual field in a table without using some grossly inelegant code?
View 6 Replies
View Related
Aug 22, 2014
i have a database that runs updates from within itself.what i need is, this database to then open a another database run a update query, then close it.
View 4 Replies
View Related
Oct 22, 2014
I have a database with my staff in. If they are car drivers I take not of their Insurance and MOT renewal dates. I have built a query that gives me a reminder date ten days before and 5 days after the renewal. I also have an email function that emails my administrators the dates of these. Is there a way of getting the database to email specifically on those dates. I.e. a reminder 10 days before and a check 5 days after?
View 3 Replies
View Related
Aug 7, 2014
I have 2 database files.
database A has a button (buttonRun) that when clicked, it opens database B and runs the autoexec macro.
In database A, there's a label control (lblRun) next to the buttonRun that has its back style property set to transparent.
What I'm trying to accomplish is this:
After the procedure in database B completes, it exits the system. I want
lblRun's back style property to be set to normal.
I already have a function that does this and the function works fine from within the database A.
Code:
Dim frm As Form
Dim color As Variant
Set frm = Form_frmReportingDashboard
frm!lbl_cmslite.BackStyle = 1
I need to trigger that function from database B before it exits.
View 8 Replies
View Related
Dec 11, 2013
Access 2007, split database, 9 users. I have been able to link the BE tables with the Linked Table Manager. I use the DNS name path because everyone has different drive mappings. I can open my linked tables as a RecordSet and AddNew and Update records. However, I cannot Seek and Edit the linked tables. I understand that I need to open the BE tables directly in order to do this. Now, I can do a connection like this, and it works for me:
Dim dbs As DAO.Database
Set dbs = DBEngine.OpenDatabase("R:DataTask_be.accdb")
But, as I said, everyone has different drive mappings. Therefore, I need to use the Network address instead of a drive letter. I tried this:
Set dbs = DBEngine.OpenDatabase("ServerMyBackEndDataTas k_be.accdb").
View 3 Replies
View Related
Aug 26, 2014
I am trying to open a database with a password (I know the password) from another database however I cannot work out how to do it. I have been using this code to do this to open databases without passwords for a while.
I am using Access 2007.
Code:
Private Sub Command36_Click()
Const cstrClientFEPath = "G:Templates"
Const cstrFEFile = "db.accdb"
Dim intX As Integer 'Utility var
[Code] ....
View 3 Replies
View Related
Feb 7, 2014
how to stop this error from occuring. "Potential Security Concern" I get this everytime a query runs that is creating a file for exporting. The database is in a trusted location, the query is a make table query if that makes a difference.
View 1 Replies
View Related
Jun 10, 2015
I am using Access 2010 in a split database. The intent is to place the back end and associated linked files on a server and the front end on work stations for each user. The typical user will just be searching for information in the database not altering it. My current code re-links the tables once the path is known i.e. I have to hard code it into the global constant. Is there a way in VBA or utilizing VBA to read/write to an ini file (for example) that the UNC path would automatically be updated to a global constant in my current code that can be updated automatically based on where the back end is installed.
Global Const BE_DATABASE = "192.168.2.3FMCENFMCTABLES.accdb"
Global Const BE_PASSWORD = "***********"
Global Const BE_DATABASEPATH = "192.168.2.3FMC" 'used to open files
Public Sub CreateDatabaseLinks()
On Error Resume Next 'new
Dim ws As DAO.Workspace
Dim db As DAO.Database
Dim td As DAO.TableDef
[code]...
View 5 Replies
View Related
Jan 24, 2014
I am using the following event code to open a database from another. Everything works fine but, I would like add a mxgbox letting the user know the database does not exists and to contact me for assistance.
Private Sub cmdOpenTime_Click()
Dim accapp As Access.Application
Set accapp = New Access.Application
accapp.OpenCurrentDatabase ("c:PILOT_ApplicationTIME.Accdb")
accapp.Visible = True
End Sub
View 5 Replies
View Related
Mar 28, 2014
I have two databases, both have mysql backened and access frontend.
In first database, I'd like to access the second database, check if that person has an entry in the second database and then fetch that data into the first database. To make it easier, data come from different tables (though I'd probably access only one entry in each table)
Not sure where to start, the only idea I have is to link tables from both databases into the frontend ad then it's kinda easy (would have to rename the tables).
View 1 Replies
View Related
Oct 23, 2014
I was curious if there is a way to embed images into a database, so that if I emailed it to someone, the images would still be able to open. I tried using a table and adding attachments, but that doesn't seem to work very well.
View 6 Replies
View Related
Apr 18, 2014
I have a database split into a front-end and a back-end. The back-end is stored on a shared drive. I have learnt that any user who has only read access to the shared drive and opens the front-end will be opening the database in Exclusive Mode as he'll be unable to create the locking file and would hence be inhibiting all other users from editing the database.
This is a game spoiler. Is it possible to disable this user from opening the database at all. Or can we do a check in VBA if the user has opened it in exclusive mode and then just push him out giving an error message.;
View 1 Replies
View Related
Jul 23, 2015
I created a database that uses the "lngEmpName " number to give user permissions , what I need is to be able to disable the running of the database (or main form)and show an error message using vba if I have not logged in for around two weeks is this possible ? if so how and even better a demo would be fantastic.
View 4 Replies
View Related
Jan 6, 2015
I need to pass a variable from one Access Database to another
The scenario is I have a item number in one database that I need to use to open a form in another database,
I can open the database using vba, currently launching a BAT file that copies the latest version database to a local drive and then opens it,
Is there an easy way to pass the variable after this has completed?
View 1 Replies
View Related
Sep 26, 2013
I have 2 databases (accdb). Both databases have a loading pop form. Also both databases include the following line of code when the loading form opens:
Code:
docmd.runcommand acCmdAppMinimize
This code works great when I open the databases individually. but my problem is that I have a label on the pop form in accdb 1 with its hyperlink address set to accdb 2 and the subaddress set to the macro name.The hyperlink opens the database 2 just fine and it opens the loading form but it doesn't minimize the application window.
View 1 Replies
View Related
Nov 7, 2014
I have a POS system, packaged with Access Runtime, running on a PC and have developed a database system to provide additional function. I have no documentation to the names of the Forms or Controls in POS. My ADDON system does link to the POS Tables and has some Tables of its own.
At the time in the POS system where the cashier checks out the customer, they need to AltTab to my ADDON system to enter some information for the customer. They remember to CustomerKey from the screen on the POS system and key it into a Form Control in my ADDON system.I want to, from my ADDON system, read the value of the CustomerKey in POS and fill it in so the cashier does not need to remember/type it.
Is it possible to get the data from another already running Access database?I don't know the name of the control. Is it possible to run through a list of Forms and Controls in the POS system from my ADDON system?
I do know the name of the field in the Table and expect it to be current and might have to get that?Failing all that, is there a Collection of running Access databases? I could go through its Forms and Controls one time looking for what i want.
View 1 Replies
View Related
Jun 24, 2013
I need to create a form to input records (or modify records) however im unaware of the methods that could be used to actually put the data into the tables..my current method is using:
Code:
Dim dbs as DAO.Database
Set dbs As CurrentDB
Dim InsertSQL As String
InsertSQL = "INSERT INTO [Table] (Columns) VALUES (Values)"
dbs.Execute InsertSQL
I am not sure if this is the most effecient or best or if it has issues that other methods or ways to use but doing this seems to do the trick.
View 3 Replies
View Related
Sep 23, 2014
I have a split database. When the front end db is updated, i am attempting to delete the end users copy and replace with the updated version.
I have gotten as far as being able to open Database A, Open Database B with A and Close Database A, but it will not let me delete Database A from B because the procedure originated from Database A.
View 11 Replies
View Related
Jul 16, 2013
So I am using the following code:
Code:
Declare Function WNetGetUser Lib "mpr.dll" _
Alias "WNetGetUserA" (ByVal lpName As String, _
ByVal lpUserName As String, lpnLength As Long) As Long
[code]...
My question is how can I create a table listed with numbers as an access list? Right now only the ######## has access but I'd like to create a table for numbers who will have access.
View 6 Replies
View Related