I've a custom menu bar from which I can choose any of my forms. However when you choose a new form the old form stays open, sloppy in my mind. Is there any way i can choose the new form from the menu bar & close the previous form? I've tried to close on deactivate, w/ no luck.
I've created a popup menu form to be loaded when you cick on another form. I need to know how to get the popup menu form to close when you click off it. I've tried using lostfocus and deactivate but that didn't work. Modal is set to no. What code should i use and where would it go?
I have an MS Access problem I need some help with. I am trying open a form for input from selection in a drop down menu in an access database. Any ideas on how I should do this??:confused:
Folks, i open my relationship window from a form and i after hide its visibility using the code below. DoCmd.RunCommand acCmdRelationships Forms![frmRelations].Visible = False I need to open the hidden form after clicking on the close(x) button of the relationship window. Are there any ideas please.
I was wondering if someone could point me in the direction of how to have a form open to the record it was on when it was closed. I know I've seen how to do this before, but I've spent some time searching and I can't seem to find it again.
I am tying to create a cmd btn called "Report" that when clicked opens a form [quick report] in dialog window. I have that done easy enough. But what I want is if that form [quick report] is open, and you click the same button "Report" for it to then close the form.
I am at my Login Screen, I want it to return to the Login Screen if you select "NO" and Close the DB if "YES"
Here is my current code:
Private Sub Form_Close() If MsgBox("Would you like to EXIT the Database?", vbYesNo, "Quiting Database") = vbYes Then Application.Quit Else ??? End If End Sub
I have a split form that's like a list of pending tasks. The data source is a linked SharePoint 2013 list where users submit requests. The user takes the information from each record and performs an action. When it is done, the user presses a button and the task status changes from "Pending" to "Processed". The form record source is based on a query that finds only records with a status of "Pending" so when the user changes the status of the task, it is removed from the list. It works fine except when there is only one task left in the work list. If the user processes the last task, the form refreshes and it goes to a new empty record and I get an error message that says I must enter a value into one of the required fields. I tried making the field non-required but it just creates an empty record in the table.
I am using the method from allen browne [URL] .... to open a form and add it to a collection and when removing it it closes. actually, usually it does work so but i have now a form which does not close until i am hitting the reset button in VBE , is there something i could check why it's not functioning as desired ?
Just to add, this form has a subForm as well (might be the cause ?)
I have a timer form which closes the database after a period of time with DoCmd.Quit. Another form is open at this point but if a user has left it in the middle of editing it I want to be able to save the record in the other form and close it before the timer form closes the database.
What VBA do I need in the timer form to save the record and close the other form before DoCmd.Quit? Just to be clear the code is...
Private Sub Form_Timer() On Error Resume Next Me.Tag = Val(Me.Tag) - (Me.TimerInterval / 1000) Me.Caption = "The database will exit in " & Me.Tag & " seconds" If Val(Me.Tag) <= 0 Then
Basically I have a Customer Form, which I have a New party button on it,this button opens up the party form to a new party, what I would like it to do is open up a new party but make the new party for the customer I had selected in the previous form.I have tried the GoTo macro's but cannot seem to get it to work.
I am thinking on clicking the button it will need to get the Customer ID, and then open the party form, create new party, and paste in the Customer ID, which then updates the Name - Date - Address - Company Fields.
I have a database with a Main Menu Form, containing a Button that loads my main data entry form. When the Button is Clicked portions of the data entry form that is loading shows through the Main Form Background (e.g. portions of the navigation bars, and portions of the boarder on the form that is loading.)
When the user clicks to close the form the Before Update event runs, and has the following code to check that all the required fields are completed:
If IsNull(Me.ToxReceived) Then stdresponse = (MsgBox("You must enter the toxicology received date before continuing." & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _ "Do you want to do that now? Click YES to return to complete the form, click NO to undo the record", vbYesNo, "Missing Data"))
If stdresponse = vbYes Then Me.ToxReceived.SetFocus
Else Cancel = True Me.Undo Exit Sub End If End If
If the user clicks no, and the record is undone, how do I get the close form event to still continue?
i put a button that run the command "docmd.close" but i found when i click it it close the form but with saving all data in field in the table, but this button should cancel record insertion, i hope i can find the answer here.
I have a form that I want only to be opened from another form (i.e. the user presses a button from form1 and form2 is magically displayed).
My solution: In form2, I check to see if form1 is open in "use" mode. If not, I display a message and close form2.
The problem: The close code (docmd.close) is at the beginning of Form_Current. Apparently, Form_Current doesn't like to be interrupted. I receive a run-time error 2585 (This action can't be carried out while processing a form or report event).
Ok, so, umm, how exactly am I supposed to close the form? I tried the check during Form_Load instead, using the cancel variable instead of the docmd.close. However, I don't think this code got executed. It's almost like the form was already loaded or the Form_Load occurs after Form_Current (In my handy chart here, it says that Form_Current occurs when a form containing data is first opened and when you move to a different record.. so, I suppose it is possible).
why a form won't close. Each time I try to I am prompted to save and when I do, the form doesn't close. When I closed the DB and reopened, none of the changes were saved.
Hello. Is it possible to close all open reports from one button on a form?
The form is a popup that appears if there are no records in a report. When the popup appears, and the user clicks OK, it is running a macro that closes the popup form and then the report. I would like to use this popup form for a number of reports, so obviously the macro cannot be used as it is only for one report.
I'm trying to find out what's the best (or good ways) to open and close a database (*.mdb) in ASP without worrying about it staying open. The website stops running (page not displayed) after it has been visited several times I think, or it's happening when I'm creating new scripts I made which crash several times during debugging. Not sure what's causing it.
Here's how the db connections work. I'm basically using (includes) to do lots of this.. every web page that requires the DB, I do this format...
(includefile: open database) (includefile: create constants/variables) (includefile: load functions used) - the html page, which access functions when needed - (includefile: close database)
the includefile that holds all the function scripts does not open or close the db at all but only the recordsets semi-example function (function) rs.open "", cn <--- the cn was opened in the database script - blah = the stuff - rs.close (end function)
Is this a good way to work with the database? I'm using access. Yes, i know sql servers are better, but I was told that since I have only access, I want to minimize the number of connections, so I open the database once during the page being opened, and close at the end of the page.
Like I say, the problem is, the site works great for a while (no real visitors yet as it's new), but it suddenly says "page not displayed" after a while. NORMALLY this happens when I'm making new functions/webpages and did the coding wrong while the database is still open. I'm thinking it's crashing because there were too many errors during the database being open.
PLEASE HELP!
BTW, is it possible to just run a script that finds ALL the open connections after a crash and close them?
I have searched and read and figured out how to make a custom menu bar. I see how I can use the forms property sheet to change the menubar that is available when it is open.
I've also seen code to hide the database window so that the form appears as a stand alone application. Like these links:
When I change the forms menubar property to me menubar, my menu bar is dsplayed when I open the form. It is displayed in the Access window, not in my form.
Hi, I want to have some queries run during the database is closed, like the functiona with "Repair on Close". But I don't want to use a form with a VBA code doing it. Is there any other possibility to do it? :confused: Thanks in advance for answers.:)
I've got a database with a linked table to a CSV file which is automatically extracted from some logging software. The Database is used to search for text strings (e.g. "example") within several fields wichin the automated extract and then show the results with any duplicated instances taken out (via an append to table query which is indexed with no duplicates).
So:
Text is entered FieldA is looked through for a match, if a match is found the whole record gets appended to the Append table. FieldB is looked through and if a match is found the whole record (including field A) is appended, however if the match has already been found in A, then the record is not copied. It does this for several fields and then you get a table which is every record containing the searched for text with no duplicates. This table is then displayed as a subform on another form in it's "table" view.
The form I'm trying to close is the form which contains the above subform.
I've tried:
A macro with close -> form -> formname which doesn't work. Code: Private Sub Toggle2_Click() On Error GoTo Err_Toggle2_Click
HOWEVER, just to make things interesting, if I click to view the form design, then run the form again, it will close fine using either method. It just seems not to work on the initial run of the text search which then opens the form displaying the subform.