Modules & VBA :: Check If All Forms Are Closed
Apr 9, 2015
I am creating a few forms one of which is the MAIN FORM that closes upon opening another form.
What I am looking for is when another form closes, if no other forms are open, then open the MAIN FORM again.
Can I use this : If CurrentProject.AllForms("BUT KEEP THIS EMPTY").IsLoaded Then ???
View Replies
ADVERTISEMENT
Oct 17, 2006
I've been stomping around in the forums for an hour now and I have to ask for some help because I really don't know what it is I am looking for.
I am interested to know if there is a way to write VBA code that reopens my menu form if all other forms have been closed. The database window is hidden in my app and normally when all windows close this will exit Microsoft Access too.
If there's not an easy, established way for this, I'm not really in a spot that requires me to use this, I just wanted to know for future forms.
I guess my real question is how to you build events for the entire database, not just a single form or report?:confused:
View 4 Replies
View Related
Oct 15, 2014
I am using the following line of excel vba code to extract the name of excel file that I would like to compare with Access table data.
Code:
strFile = Application.GetOpenFilename("Excel Files,*.xls*")
textbox1=strfile
Now i want to write VBA code to check sheet name "Summary" in that workbook and check if any of column D value matches with Access table tblmain field "Reference" values. If yes then change the status field of tblmain to "Yes".
View 1 Replies
View Related
Nov 23, 2005
I have a DB with 20 forms. All of the forms are closed. I opened a new form and added a button. I would like to do the following when the button is clicked:
Check the "Tag" property of each form and count whichever is not null.
Can anybody help me out??::o
View 1 Replies
View Related
Oct 17, 2006
Evening All! (Old enough to remember Dixon of Dock Green (stupid enough to mention it!))
I'm working on a small database for a small team of support workers with a
client base of 60 clients at anyone time, although the turnover is quite
substantial.
I have done some searches on archiving records but am concerned that once
archived a record would be difficult to re-integrate in to the live database,
particularly if there have been changes to it?
I have considered that I may be just as well slapping a big label over every
record that has a date in the [CloseDate] field and if a closed case is
re-opened, the closed date is removed and the label disappears.
I'm still open to being convinced that the archiving is the way to go, but
in the mean time I hope someone will be able to help with the expression
needed in the form on_current procedure to make the label visible. If it was
just a tick box I'd be flying by now, but I can't get my head around getting
a populated [CloseDate] field to initiate the CloseRecordLabel.
Thanks in advance
Doug
View 9 Replies
View Related
Apr 22, 2015
I have a MainForm. Using a button on the MainForm i open an PopUp form which I enter values.
I want to save the value of a field (text), close the PopUp form. Then use the Saved value in the MainForm to find a record.
So far I have this but not working:
Code:
TempVars.Add "company", Me.CompanyName.Value
If Me.Dirty = True Then
Me.Undo
End If
DoCmd.Close
DoCmd.OpenForm "MainForm"
DoCmd.Requery
DoCmd.FindRecord Forms![MainForm]![CompanyName] = TempVars("company")
DoCmd.GoToControl "Combo48"
View 5 Replies
View Related
Feb 25, 2014
I keep on getting this error. The weird part is that I have exactly the same stored procedure but insted of FinancialYear it has a calendar year. So instead of of having something like '2013', it has 'FY2012 - 2013'. The calendar year SP works perfectly, but this does not.
Option Compare Database
Dim objConn As ADODB.Connection
'Use this code to run the SP and extract all the records
Public Sub LoadVRData()
Dim rsData As ADODB.Recordset
[code]....
View 2 Replies
View Related
Sep 26, 2013
I have a main form called frmAF54. In this main form I have a subform named frmPassdown. The subform record source is from a table called tblCards. This table contains many different cards. I have a combobox called lstOpCard in the main form as well. The combobox lists all of the different cards in "tblCards". I have a button called "buttonFilter".
A user opens the form and clicks (or selects) the different cards in the combo box "lstOpCard" that they want to filter for. Once their selections are made, they can click the "buttonFilter" button and the subform "frmPassdown" will be filtered based off of their selections.
The filter is applied using the IN() function as shown below:
Me.AF54PassDown.Form.Filter = "[OpCardID] IN ( " & sTemp & " )" --sTemp is a string containing the keyIDs of the cards selected.
My problem is that people will be opening and closing the form throughout the day / week. When the form closes, it loses the applied filter. How can I have my filter on the subform be saved after the form is closed and the filter is still applied when the form is opened later?
View 1 Replies
View Related
Feb 5, 2015
There is a form where whenever the form is closed, the below code needs to execute:
If IsNull(Me.CostPerPiece1.Value) = True And IsNull(Me.CostPerPiece2.Value) = True And IsNull(Me.CostPerPiece3.Value) = True And IsNull(Me.CostPerPiece4.Value) = True And IsNull(Me.CostPerPiece5.Value) = True Then
Me.AllowAdditions = False
DoCmd.SetWarnings (0)
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings (-1)
Else
Call AppendQuoteCharges
End If
The If Then just looks at if certain fields are all null and if so, it deletes the current record. If at least one field is not null, the AppendQuoteCharges routine is called.
The form has 4 or 5 navigation buttons that close this form and send you to a different one. I've added the above code to each of those buttons before it runs the DoCmd.Close Form. I also have a Exit button that runs a DoCmd.Quit. I developed this months back but I'm pretty sure I added the above code under each button's click event rather than a Form On Close event because Form On Close does not execute after a DoCmd.Quit command
In rare cases, the form is being closed without the routine being ran. I think if a user clicks the Close button in the top right of Access (the X), it might be running a DoCmd.Quit which is doesn't run this code.
How can I be sure that whenever the form is closed or exited, the code is ran? Is there a way to tie this code to the user clicking the X in the top right?
View 2 Replies
View Related
Jun 25, 2006
I have a remote DB with some Forms. Some forms have commandButtons in them, and some don't.
I have a Table called "test" in my current DB.
I need to look for command buttons in each Form, and populate their names into my "test" table.
Is it possible???
View 2 Replies
View Related
Aug 29, 2013
I have several forms in my database that have a closed (1=Closed) option button. Is there a way to make all of the fields for that record readonly if the closed option is set to equal 1?
View 3 Replies
View Related
Jan 5, 2014
I have a database with a main menu which opens up on start-up it works fine and all but I want to go the extra step, I wish to disable / hide the ribbons (Top and Bottom) - Or Hide the whole Microsoft Access Window and display my form with the desktop behind it.
The next thing is once I click the X or the button to close the form I want Microsoft Access to appear again as in everything to show itself again.
View 1 Replies
View Related
Nov 28, 2013
I have a form in Access2000 with 5 text fields which get transferred to the table for each new record. Is there a way i can "LOCK" one field so that once the user has input that data it never changes until closed. I can already lock the field but once i create a new record the field then goes blank.
View 4 Replies
View Related
Jun 26, 2014
how can i make a image appear in my form when there is a check in the check box from the table?
View 14 Replies
View Related
May 1, 2014
I have a series of forms that become current in a certain order. For example a menu form comes up. This is followed by a search form where the user gives search parameters. Then appears the results list. If the user wants a detail form comes after that, etc. Now when the user closes the last form I want the form before that one to show up and when he closes that one the one before that and so on. That is I am going to use the close button to go back to the previous step. How can I do this.
View 5 Replies
View Related
Nov 16, 2013
Sending email using VBA & HTML. I want send email from access. Message in body contains some text and table in HTML format. I need check if email was really sent or cancelled with user.
Code:
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
With objMail
'Set body format to HTML
[Code] ...
I need some message (for example):
If error then
MsgBox "Email not sent"
Else
MsgBox "Email sent"
End If
View 2 Replies
View Related
Feb 4, 2014
I have value in the form call (welder) & based on the other data i will enter in form i need VBA to check if this welder is certified to do the job or not.
View 4 Replies
View Related
Jun 15, 2007
Hi.
Is there any way to make a form open up when every thing else is closed.
Can I make a macro that will check if everything else is closed and then open the startup form again?
Is anything like this possible?
Thanks
Richard
View 1 Replies
View Related
Sep 25, 2005
Hi all,
I am stumped as to how to get a form to update/refresh. Heres what I have!
My main form:[Daily Log From] is opened, with a subform:[DailyDSQry subform] populated by a Query. This form has a command button that opens another form: [NewDSLog] in "acAdd","acDialog".
What I need is: when the [NewDSLog] form closes, the [DailyDSQry Subform] needs to requery/update so that it displays the new entry.
I have tried the following in a command "CLOSE" button in form [NewDSLog]:
docmd.Runcommand AcCmdRecordSave
Me!Forms![Daily Log]![DailyDSQry subform].Refesh
Me!Forms![DailyDSQry subform].[Query].!Requery
doCmd.close
but no LUCK.....Keep getting errors
Any Ideas
Thanks all, I do appreciate the help
Enviva
View 1 Replies
View Related
Jun 23, 2006
I have two date fields that I am using a form to show the open and close date of an investigation. The opened date field is controlled by a textbox elsewhere on the form, but the date closed is controlled by the vbCalendar control. What I am trying to do in coding is to evaluate whether or not the closed date is before the open date. If the date closed is before the date open I would like a message box to open that prevents the user from moving forward and reminding them that the date closed is earlier than the date open. Is it possible with the vbCalendar option being able to change its focus continually.
View 1 Replies
View Related
Oct 6, 2006
I have a form which is associated with a table. When I put some values in the fields which are connected to the database and try to close the form, it gives me an error that "Can't insert record the primary key might be duplicated"...! and then it closes.
Does the form store a record in the table while closing??
If so is there a way to prevent it??
Please reply..
View 3 Replies
View Related
Mar 15, 2013
I would like to have the Switchboard I created open when the database is selected. I used Tools/Startup to set this up. It works to a point. The database window opens and THEN the Switchboard opens (on top of the database window). There are some who I wish not to see the database navigation window). Also, is it possible to OPEN the switchboard again when a Form is closed?
View 1 Replies
View Related
Nov 24, 2014
I am required to write a code to check the positioning of a text in a string.
E.g.
"~[Admin]~xxxxxxxxx~ACK~" = Acknowledged
"~xxxxxxxxx~[Admin]~ACK~" = Not Acknowledged
"~xxxxxxxxx~ACK~[Admin]~" = Not Acknowledged
As you can see, as long as the string starts with "~[Admin]~", it is counted as acknowledged. If the "~[Admin]~" appears anywhere else except the start, it is counted as not acknowledged.
I know I'll have to use If-else statements and EOF to cycle through my entire column, but how do I check the positioning of "~[Admin]~"?
Are there wildcard statements that Access VBA can use similar to SQL's "*"?
View 8 Replies
View Related
Oct 23, 2014
I'm trying to create some code that will create a new folder depending on the ID that is currently being added to the database.What happens at the moment is a new ID is generated which in turn is job reference.When this is added to the database a folder is created with a prefix of this ID number and a 20char test specified in a text field by the user.
What I am trying to achieve is this:If the ID = 57...Then a folder is create called 1 - 500 (and ignore if one has already been created, which it should have at ID number 1)...When the ID Number 501 comes along another new folder is create called 501 - 1000 etc etc.The idea is not to have 3000+ folders in just one folder making it look a bit messy and lengthy to look through.
View 3 Replies
View Related
Jan 2, 2014
I have created a form which enbles users to enter data into the fields which will add a new record to my table. What I am trying to do now is to create some kind of validation rule that will check whether the record already exists.
I need it to work this way; there are four input fields- 3 text and 1 is a date filed. When the user enters a new record they are not allowed to create a record that conatins the same combination of values. So if one record has for example filed 1 = 1 field 2 = abc field 3 = def; then no other record can have the same combination of values.
If the user enters an already existing combination there would be an error message saying which field is incorrect. If the combination doesn't exist it would add the record and display a message that the record was successfully added.
How can I do this?
View 11 Replies
View Related
May 2, 2014
I'm trying to figure out how to filter a report using a check box.
I have created a form, which if you push an industry labled button on that form it will show you the report with what work was done for that industry.
Now I'm trying to modify it so that I have a group of check boxes; each check box being a different office location the company has.
What I want to make happen is if say out of office A. B. C. and D., A. and D. are checked and I hit the button of a specific industry it will bring me up a report of office A. and D. Combined for that industry.
From what I've figured I can create a bunch of reports of all the different possiblities and link those to that senerio, but that seems tedious and ridiculous.
Is there a way I can code VBA to do this for me? Or am I going to have to go through the proccess of creating a bunch of different querries and reports beyond what I have now to pull up an industry.
View 8 Replies
View Related