I have created a button which when clicked imports a table from Excel into Access. Every month the users want to click on this, they want to update the Access table with the updated info in the excel table. My problem is that the whole table is imported again and not just the new rows which have been added in excel. I was just wondering if there was a way to have a button which when clicked it clears all of the records out of my table in access, instead of manually deleting them. So that my users can just click this and then click the import button.
I have a database of personnel. People come and go all the time; however I can't have a personnel record deleted as soon as they leave. They remain on our books until a specified date for each individual. The date is different for each individual. I was hoping to have a field in their record with the date, and have a query or some code delete that record on the date in the field. Is this possible?
I want to remove the record buttons at the bottom of my form and only have a submit button. I will have a form for editing, because I don't want people to have edit access, only new record. Can this be done?
I have created a form and have put a delete button on it to delete the active record. This works fine in that it deletes the record as required.
However, at the top of the form is a combo box which can be used to find records. Once a record has been deleted, it is still listed in this combo box but as #Deleted!. Closing down the form and reopening it corrects this and the #Deleted! entry disappears.
How can I get around this? Possibly by making Access refresh the form after the delete command? If that's the correct solution, how do I do it?! Otherwise, is there a better way.
I am creating a form that includes an add and delete button on the form. I have two other databases that these buttons work with. Using the same VB code (and name of the button) in my current database gives me the following error:
"The express On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Office Access was communicating with the OLE server or ActiveX Control.
*The express may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro."
My VB code is as follows for the two buttons:
Option Compare Database Private Sub add_Click() On Error GoTo Err_add_Click
Private Sub DeleteRecords_Click() Dim db As Database Set db = CurrentDb db.Execute "Delete * FROM tblJune 2005 applicants;" End Sub
I am trying to delete all records from a dabase created in access. When I click the command button, I get this message: "User-defined type not defined"
Hokay, firstly my apologies if this is the wrong subforum, but since my question revolves around the behaviour of one of my forms I guessed the thread should go here.
I have a very simple little database which I use to log RMAs (Returned Merchandise Authorizations). The database consists of three forms:
Form A - The switchboard. The main menu, works fine. Form B - The View/Edit window. Allows me to look at the records in the database and alter them if necessary, works fine. Form C - The Add window. Has the same form layout as B, but allows for adding records only. This is the one causing problems.
Now the situation is that when I enter Form C, the box for the RMA number gets autofilled out - which is correct - thus creating a new record. However, what I want to achieve is a button on the form that will allow me to quit back to the main menu without saving the record that has been created by opening the form. This is for situations where the form has been accidentally opened, or where a form has been started, but is not required to be finished.
I am building a db for reservations for my limo company. I want to have a cmd button that verifies the user to make sure she wants to delete a run. This is what I have so far:
Private Sub cmdDeleteRun_Click() Dim Response Response = msgbox("Are you sure you want to delete this run?", vbYesNoCancel + vbCritical, "Really delete run?") If Response = vbYes Then
End Sub
I don't know what I am missing for the cmd to actually delete it.
For school I have to make a application in access how to delete a selected record in the table in a subform by using a button. The subform is in the main form and the button is also in the main form
I have created a form and need to be able to delete employees from a table. I built a command button using the wizard and this is the current vb code-
Code: Private Sub cmdDeleteEmployee_Click() On Error GoTo Err_cmdDeleteEmployee_Click
DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand acCmdDeleteRecord Exit_cmdDeleteEmployee_Click: Exit Sub Err_cmdDeleteEmployee_Click: MsgBox Err.Description Resume Exit_cmdDeleteEmployee_Click End Sub
But when I click on the button I get a message saying it would create duplicate data in the table.
All I am trying to do is insert to have a form with a "Delete Record" button on it. The problem is I don't want anyone to be able to delete a record, I would like someone to have to insert a password to confirm the delete.
I am creating a web database where users submit entries using an online form. When they submit the entry, I am saving the entry date and time in a column called Timestamp. What I need to figure out is if there is a way to create some sort of expiration date, based on the Timestamp, that will automatically delete a record after it is 7 days old. Is there a way to do this? Thanks so much for any help that you can give.
I have built a db where users enter the requested information, can update, search etc. However, after about 90 days the infomration is really not any good anymore. I would like to be able ot have a way to auto delete info that it over the 90 days.
I have a column named (date) and it automatically creates the date and time via Now() function. It would be nice to have something that would delete via that columns date.
Any suggestions?
I know that I can query and delete multiple records via Access but I have worked hard to keep me out of the day to day db funtion.
I have two simple tables. I want to delete the records from Table1 that are on Table2. I've created a select query that gives me what I want but when I change to a delete query, I get this message: "Unable to delete from specified tables"
I think my problem has something to do with security but I can't figure out what to change.
I have a wizard made delete record button on my form and up until today it worked fine. Now when clicked an error message comes up saying: cant find the field 'forms' referred to in your expression. I have no field 'form' in any of the tables or queries relating to this form, in any of my tables in fact, i don't have a clue what is wrong and why it suddenly wont work. Can anyone help please. Thanks
I currently have a button that holds a delete command. When the button is clicked, a MsgBox pops up and ensures that you want to delete (yes and no); Yes deletes, No cancels.
Now I need to change it around a bit so that it is more secure. I would like add an 'authorization' code (password). When the msgbox appears, I would like it to have a text box where the user needs to enter in the password, if the password is correct then it would delete, if wrong then cancel.
I need help. I finish my contract tomorrow and this is all I have left
I have a delete query in my database which I would like to run from a command button on a switchboard. When I use the command button wizard, it does not show delete queries in the menu of available queries. If I create a command button manually I will need VBA code for the event procedure.
Can someone give me an appropriate code for running a delete query with a command button?
hi.. i have 3 forms: master, request & progress. progress is a subform for request, and request is a subform for master. i added "add new record" and "delete record" buttons using the command button wizard in request form. the problem is, when the buttons are clicked, i get this message: you cant go to the specified record. you may be at the end of a recordset.
by the way, each of the forms source is master, request and progress table respectively. please helpppp
The purpose of this database is to have a simple form that inputs data into a table. There is a subform view on the form so they are able to see their data that was submitted into the table.
Problem:I have made an attempt at making a Delete Row button. The idea behind this is to allow them to select a row on the subform view and then delete it from the table.
Form = frmEvaluationForm Subform = frmReviewSubForm Table = tblEvaluationDatabase
figuring out what is causing this error 3075 (syntax error in query expre. Is there a more specific way to delete a row that has been selected?
Access 2007
Code:
Private Sub cmdDelete_Click() 'check existing selected record If Not (Me.frmReviewSubForm.Form.Recordset.EOF And Me.frmReviewSubForm.Form.Recordset.BOF) Then 'confirm delete If MsgBox("Delete this record?", vbQuestion + vbYesNo, "Delete") = vbYes Then 'delete now CurrentDb.Execute "DELETE * FROM tblEvaluationDatabase WHERE CAccount = " & Me.txtCAccount 'refresh data in list Me.frmReviewSubForm.Form.Requery End If End If End Sub
I'm having problems making a command button(Ta bort från engelska till svenska) of a delete query. The name of the query is"Ta bort från engelska till svenska", which is also the name of the button on the form(huvudformulär)
Could someone please help me. I'll enclose my zipped database.
Good Evening, I wonder if anyone could help me please......... I have found Ghudsons attached ‘Browsing2’ example to be of enormous benefit/use to me when I have been creating various Databases, however I was wondering whether Ghudson or any other kind person(s) would either show or point me in the right direction as to how to create a ‘Delete’ facility which is very similar to the ‘Open’ command button on the continuous form.
I have attempted to adapt the enclosed 'coding' to see if it will come up with the result that I want, but unfortunately I cannot!
Attachment kind courtesy of Ghudson http://www.access-programmers.co.uk/forums/showthread.php?t=97787&highlight=browsing
Your help or assistance in this matter would be very welcome...........
I have created a form where data is entered. I wish to place a command button on the form and when it is pressed, it deletes data in specified textboxes. The texboxes are: LAST_NAME, FIRST_NAME, MIDDLE_NAME.
I assume this is done using vb, but I am clueless.