Hi,
Have a main form with subform. Can udo edits on the main form and am trying to do the same for the subform and am having problems. Can someone correct my syntax for me please..........and maybe someday I'll get it!
Here's my code below....thanx.
Private Sub PDEditUndoBut_Click()
On Error GoTo Err_PDEditUndoBut_Click
I have a form with a subform, on the mainform there is an undo button but when someone makes changes on the subform the undo button wont run and the error message "The command or action Undo isn't available now". How can i get the mainform to detect that changes have been made on the subform and then if the button is clicked undo the changes.
I have a form and a linked subform which are linked by Purchase Order Number. When items have been delivered on the purchase order, the user should update the continuous subform with the number of items that have been delivered. This works fine.
The problem I have is using an exit button that does not save any of the changes to either the data in the form or the subform. It doesn't matter if there is a prompt to alert the user that there have been changes made.
I have been messing around with DoCmd.RunCommand acCmdUndo in the on click event of my exit button which kind of works when changes has accidentally been made, but is very unsophisticated - any ideas?!
I have a main form (A) with a subform that is another form with a datasheet(A_SUB)
On the form A is an undo button which rewinds any changes that occur to A that I do not wish to commit. However when I make a change to A_SUB the changes are not rewound. I considered implementing an UNDO for A_SUB but this is messy. What would be a better solution?
I have some forms where I can cancel my input. However this works only on the current record. When I implement a subform this does not work anymore. Because access auto saves when focus is set to the subform.
I don't wan't to use unbound forms. What I would like to do is when I press EDIT that a snapshot or something is taken of the current values. So I can set them back.
I can use variables for the main form, but I don't know how to save the values of the records of the subform.
Or does the possibility exist to use transactions?
I just want to be able to undo all changes regardless of the subforms.
Hi everyone!! This is my first thread in this forum..Hope to get best from this site ..well i m facing a problem..i have a main form and a subform (which is in datasheet view) . Now i have a button called "close_form" in main form on whose click event i have writen this code :
Private Sub close_form_Click() On Error Resume Next DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70 Me.Controls.Item("fees sub").SetFocus DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70 DoCmd.Close End Sub
1. If i run this form directly from Access and there are no changes i do in the form and click this button then it gets hang after showing error "run time error 2046 ; the command or action undo is not available now " "press End or Debug or help"
2. As i have created a Custom menu, if i run this form from that menu then it does not show any error. But it runs fine for the first time but nothing happens on clicking this button the second time i open the same form ( in same session). What to do ?? Please help .. shikha
I have a Memo box where the user puts comments and then I have a check box that if check automatically puts a specific phrase on the first line of the Memo box (before any other text currently in the box). What I am trying to do is have it so that if the "check box" is UN-checked it will remove the line that it just added to the Memo box. I have been able to get it to undo everything in the Memo box, but what I really need is for it to just undo the last line of text that was enterd when the user checked the box.
Example:
Memo Box: This is the line that the checkbox just added when the checkbox is set to "True" This is the test data the user has already put in the box... ==================
User now UN-checks the checkbox (I want the Memo box to read.. see below) Thereby deleting the line "This is the line that the checkbox just added when the checkbox is set to "True""
Memo Box: This is the test data the user has already put in the box...
Hi, I have found the answer to most of my problem, thanks to previous posts. I am using the Undo command on a Date field. However it seems that my code is maybe not staying on the event to action the undo.
After it runs the Focus goes to the next field Me.LeaveDays and the value is automatically entered, unless I comment back in the Goto's in which case the value will be zero.
I want to be able to Undo the EndDate (and preferable the StartDate, and Setfocus to StartDate) EndDate will do if not possible.
Don't want to Undo the whole form, although that could be a last resort.
My code is in the before_update event, image posted (ignore faded fields, not visible/needed in final solution) Private Sub EndDate_BeforeUpdate(Cancel As Integer) On Error GoTo Err_EndDate_BeforeUpdate
Dim intLeaveLeftAL As Integer Dim intLeaveLeftSL As Integer Dim intLeaveDays As Integer Dim dtNullDate As Date Dim varNullField As Variant
' Use the WorkingDays function to calc the number of Leave Days ' set LeaveDays and requery the form intLeaveDays = WorkingDays(Me.StartDate, Me.EndDate)
If Me.LCode = "LC41" Then ' Sick Leave
Select Case intLeaveDays Case Is > intLeaveLeftSL MsgBox "Employee does not have enough Leave" & vbCrLf & "to take as Sick Leave.", vbCritical + vbOKOnly + vbDefaultButton1, "Entry in Error" varErrorCondition = True Me.EndDate.Undo GoTo Exit_EndDate_BeforeUpdate Case Else: End Select
ElseIf Me.LCode = "LC11" Or Me.LCode = "LC13c" Then ' Annual or C/Fwd Leave
Select Case intLeaveDays Case Is > intLeaveLeftAL MsgBox "Employee does not have enough Leave" & vbCrLf & "to take as Annual Leave.", vbCritical + vbOKOnly + vbDefaultButton1, "Entry in Error" varErrorCondition = True Me.EndDate.Undo GoTo Exit_EndDate_BeforeUpdate Case Else: End Select End If
Hi all, I have a search form that pulls data from a query. The data is displayed in a subform. I would like the user to be able to edit the data from the subform. I have set all the allow properties to yes and it still doesn't work. Does this problem have anything to do with relationships.
Thanks to all, this forum has been a great help for me.
To make a long story short I have a command button that runs a query and opens a subform based on that query. I want to be able to update the records that are returned (via the subform) but I am getting an error - "This Recordset is not updateable". I've tried changing the recordset property to Dynaset (Inconsistent Updates) but that didn't seem to change anything.
I have inherited a partially completed membership Access database which I understand was originally generated from a load of linked FoxPro tables. There is a form which uses multiple tabs, the first tab contains general membership data (ie name, age etc) and this pulls data through from the 'Main' table in the database. Each of the other tabs includes a subform which shows data held in a number of different tables linked to the 'Main' table (eg, first tab - general data from 'Main table', 2nd tab - home addreses from 'Home Address' table, 3rd tab - business addresses from 'Business Address' table). All tables are linked to the 'Main' table through a common 'RegisterID' field. When I open the form I can query on any of the records and amend and items of data on the various tabs them without any problem. However if I add a new record using the >* option from the record navigation I can add data to the first tab (ie. into the 'Main' table) but if I move to the 2nd or 3rd tab I am unable to edit/add data to the fields on those tabs. But if I save the record after completing the fields on the first tab and then close the form and reopen it I can then edit the 2nd and 3rd tabs, can you suggest how I can change the setup to allow editing/adding data to the 2nd and 3rd tabs without having to close the form and reopen it please. I have checked the subforms and they are set to AllowEdit and there are NoLocks.
I've created a form that contains two subforms. Subform1 is a datasheet, subform2 is a regular form containing a subform (subform3) of it's own which is a datasheet.
Subform2 is linked to display detail information based on subform1...which works fine. Subform3 is linked to subform2 displaying additional details. When I open the master form everything displays ok and subform3 displays the correct information, but when I click on one of the records to edit it the form refreshes about 5 times and then record 1 in subform3 gets selected. In other words, I am unable to select any other record except record 1 in subform3 and thus unable to edit the records.
I have subform3 set to allow edits, additons, deletions and when I open subform3 by iteself I am able to edit/add/delete just fine.
This would all work fine if I did not need to edit subform3...all the links work perfectly and display's correct information. I am stumped. I hope I am missing something obvious.
May be this is easy for your guys. I want to freeze or lock the mainform data fields while allowing users to input, edit, delete data on a subform. I tried to change mainform properties so it can not edit, add or delete data on mainform. By doing so, I cannot do anything with subform, it seem read only as well.
I have created a form (races) with a subform (yachts in a race) to edit data in joined tables. It seems to be working well but I am having difficulty selecting which record to edit in the main form. I can scroll through the records until i get to the correct race but this won't work well when there are a large number of races to choose from.
I can see that I can use linked forms to select a race from a multi form or datasheet and call up my desired form by a double click on the ID field. This should work but isn't really elegant with users scrolling down a long datasheet to select the race record they want to work with. Is there a better way?
Races are uniquely identified by 3 attributes: SeriesDivision, Date & RaceNumber.I have created an index in the Race table for these 3 fields which forces them to be unique.I would love to create an interactive routine which asks users to select from a list for each of these 3 attributes and then returns the form for editing with the appropriate race record selected or even cascading - users select a SeriesDivision can then choose the valid dates for the selected SeriesDivision and can then select the valid raceNumbers for the selected date
i've got a Form that contains Subform with an embedded Query that contains 2 tables only (Payments & Invoices) the Join properties between them show all records from payments and what matches it from Invoices where the joined fields are equal (Invoice no).. So, when i enter certain data in the main form the Subform show the results for it from Payments table and only one field needed from the Invoices table !!
The problem is.. i can't edit or add any data in the Subform results with the previous setting, but when i completely remove the Invoices table from the embedded Query then swift to the Form and it's Subform.. i become able to edit and add data in the Subform easily... !!
So, how to enable the edit/add in the Subform with the 2 tables in the embedded Query ?! Cause it's really needed to show that field from the Invoices table.
this works fine and i can search using a requery button
however as deptartments are stored in tbldepts
when i change the query to retrieve the dept name instead of number directly from the table and i try to change this on the datasheet subform it changes it in tbldepts instead?
how can i change what dept the employee is in (as in change the number in tblemployee - but display the actual name?)
Is there a way to code something that will say do Undo All changes. I have a button called Exit without changes…and I would like to be able to undo everything that a user has just done on the form. Thanks.
Is there a way that I can make a button which will undo all the changes being made on a form (on multiple records). I have a continious form with a checkbox after each record and want to restore the 'old values' if necessary.
Thanks.
I know it's possible by record, but the tricky part is to do this on multiple records.
We have an mdb back end on our server with read / write permissions for several approved users. One of them (don't know who yet) has converted the mdb file from 1997 to 2000. Is there a way to undo this? :o (a few have both versions on their machines which is why this was possible to begin to with)
We have had this set up for almost four years now, with no issues might I add but always knew in the back of my mind something like this would happen.
I would like to be able to check to see if undo is available.
ie. i have a button thats called 'Cancel' When clicked it undo's changed and then closes the form, but if there are aren't any changes to undo it flags up an error saying not available.
I would still like it to close the form even if there are no changes to undo.
So check to see if the undo is available then undo and close if not then just close the form.
Hello All, I am finding this one difficult so felt I should post my issue. I have status field on my form. It is a bound field. A combobox - inactive, active. I wanted the field to do the following when changed If change then msgbox = Please enter reason in activity notes a vbYesCancel If they select it calls the activity notes form - this portion works. If they select cancel I tried making the field do form.field.undo (Me.statusid.undo) - something similar Cancel = True to reset the field to the original state. This fails and says my object is not valid I would be happy to take any suggestions . As always thanks in advance.
I use a listbox and a command button on a form as criteria to open another form.
The click event of my cmdbutton has the following code that runs after selecting a record in the listbox:
If IsNull(Me![NAME]) Then MsgBox "Sorry! No record selected" Exit Sub End If
DoCmd.OpenForm ("myform")
I have now created a menu bar and would now like to remove the command button and place it somewhere that can run when I select the menu to open a specific form.
Basically I need that when I select a menu from my menu bar, the code should verify is a record in the listbox has been selected. If yes, then it will open that form, if not it should run the undo command and not open the form but bring me back to the form on which is placed my listbox (frmEforms).