Delete Record And The Size Of MDB Don't Fall Down
Oct 5, 2005I delete record from a Table whit a sql transaction and the size of my mdb don't fall down, How I can do for purge or optimize the space in my MDB
Thanks .
I delete record from a Table whit a sql transaction and the size of my mdb don't fall down, How I can do for purge or optimize the space in my MDB
Thanks .
i''m currently trying to count the amount of records that fall in each month in the date complete field. i am currently using a count query and it it bringing up the dates not the month.
View 1 Replies View RelatedI 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.
When we browse through records in a subform we store the records in the database.When we want to delete a records for example the third record from the five records always the first records will be deleted. How can we delete the records where the cursor is at? When we are at the third record and press the delete button the third record from the list in the subform should be deleted.
Code:
Option Compare Database
Dim FocusBln As Boolean
Private Sub Identificeer()
Me.[Datum Aangemaakt].Visible = True
Me.[Datum Aangemaakt].SetFocus
If Me.[Datum Aangemaakt].Text = "" Then
[code]...
hi
i have a database with hyperlinked images in a sub form that show a new image for every record. on this sub form i have a zoom in and zoom out button which is VB coded. the problem i have is that when i zoom in and then go to the next record the new image is still enlarged and has not reset to the size of the image box. any idea as to what i need to do to correct this. i think i need to put some VB code on the on current event but not sure what. any help would be appreciated
thanks
I have a form that has 2 subforms. When I try to print the current file there are a few problems,
1) When you use the print option in File menu, and select "Selected Records" , it will always print the second record, no the one selected.
2) No matter how often I change the printer properties , it will not keep the paper size I request.
Is there a script I could use to set the size and print the current record ?
Will keeping your field size shorter result in a smaller MDB file?
Or does Access only use as much space as there is real data in its fields.
Way back in the dBASE III days, dBASE would pad all your "real" information with as many spaces as necessary to fill up your field. I suspect that the MDB structure is probably smarter than that.
Another question on the same topic - I believe there is a maximum number of characters in a record (4000?). Can your field sizes add up to more than 4000, as long as the actual data, all combined, never totals 4000...?
Thanks............
..dc
Using MS 2007, I have a 200 text files exported each day from another application that has two different types of lines (see below). I would like to import each text file in to a database as a single record.
Text file example (text.txt):
R111 WC 8/21/2012 7:00 Doe, John doej 10110110
First Question? Y
Second Question? N
Third Question? Y
...
Seventeenth Question? 10
As you see, I have the first row with multiple fields, but the next rows I have a question and an answer.
I would like to have this data imported as shown in the attachment. Example.zip
Most answers I see are for either multiple lines (same data and sizing). I am not sure how to handle several different lines with that vary in size and delimiters.
I have a library database that I want to delete a record in my tblStatus when the book is returned. I have found the deleteobject function but it appears that that will delete like a table or query or report or something like that. I have no need to keep track of how many times a certain book has been checked out or that John Doe has checked out books X, Y and Z. As a mater of fact that is exactly what I don't want so I just want to delete the record that says Book ZZZ was checked out by John Doe. When the book is returned I just want it available for some one else.
Thanks in advance,
Rick
Hello. I have form. and i need to delete record. Id is a unique key. When i have invisible textbox with source of this key, it's very easy to delete record from database. But is it possible to delete record with query without using textbox?
View 2 Replies View RelatedHi all, facing a little problem with my forms. Access gives me headaches everyday. Haha.
In a continuous form, I have a delete button with the following code
Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click
DoCmd.SetWarnings False
If MsgBox("Confirm deletion of the record?", vbQuestion + vbYesNo + vbDefaultButton2, "Delete?") = vbYes Then
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
End If
Exit_cmdDelete_Click:
DoCmd.SetWarnings True
Exit Sub
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click
End Sub
However, after the record is deleted, the focus is immediately set to the next field which creates a new record of null data. And since the fields are all required, I am forced to enter data into the new record, if not a pop up will inform to user to enter data.
I do not wish for this new record to be created everytime I delete a row. How do I go about it?
I'm learning more each day! Thanks in advance..
I have a problem with 1 of my form (FrmEditDrawing) that I use to edit a specific record from 1 of my table (TblDrawing). The user will see the Data for each drawing on a form that I called (FrmViewDrawing) and will be able to edit the data for each drawing by clicking a button that will open the form "FrmEditDrawing" on the specific record. In that case I can't edit and change the data for any fields but if I open the form on its own, I can edit and change the data ?
I guess it has something to do with the fact that I open twice the same recordsets which locks the table, I am not sure. What would be the different option to solve this problem?
When you want to delete a record out of MS Access, you get the default pop-up message confirming you want to delete the record [YES] [NO].
I have a few users who are not paying attention and hitting a combination of keys (I am guessing Alt + D) and getting this message. They then do not look, and confirm the deletion of the record.
I am thinking of two ways around this.
1) Change the default to [NO] when this pop-up dialog opens up (the default is [YES]).
2) Disable this pop-up box, and then create my own to confirm the deletion.
Are either of these possible, or has anyone ever had to work around this issue? I have never had an issue with this, and was not sure how to attack it.
Let me know.
Thank you,
T.J.
i have an order form somewhat like the northwind database one. I called mine A5_frmOrders. i have a subform called A6_sfrmOrders, which is in datasheet view. I need to add a "Delete Record" button into the subform, but when i put it in the subform footer, it doesnt appear.
Like any orders subform, i have "Item", "Product", "Quantity", "Unit Price" and "Subtotal" with their corresponding labels in the Detail Section. I tried changnig the subform to "Continuous Form" and doing this :
header : Labels for "Item", "Product", "Quantity", "Unit Price" and "Subtotal"
detail : "Item", "Product", "Quantity", "Unit Price" and "Subtotal" for user to fill in
footer : Delete Record button
but even when i change to Continuous Form, it doesnt allow me to separate "Item" from its label and put one in the header and one in the detail...
how do i add in the delete record button? Is it true i cannot use datasheet view if i want a delete button?
Thanks
Why does this code not delete the current record?
DoCmd.RunSQL "DELETE * FROM [Tble-Readings]WHERE
[Tble-Readings].[ID]= " & Me![ID] & ";"
I have this code on the a Close Button and if the record is incomplete I want it to be deleted from the table. The ID field is an autonumber so it is the 1st field to get a value if a user starts entering data. I get a msg box saying 0 fileds will be deleted why? the id's do match but it does not delete??
jon
Hi,
Is it possible to delete a record from a table whilst viewing that table through a form. The awkward part though is because I have another table linked to it.
Basically the main table is Orders and the other table is Items (these items make up an order). So when I go to simply click on delete an error message appears saying that I cannot delete the record but there are records attached to it in another table. This is fair enough but is there a smooth way off deleting off the items?
Many thanks,
Paul.
Hi guys,
Could anyone give me a solution to protect a table and all the records in there so they can never be deleted when being viewed.
Many thanks, Ben
Hi all, whats the simplest way to delete the last record in a table? based on
DoCmd.RunSQL "DELETE * FROM
Trying to use a button to do the above
Cheers
i have a table1 in my msaccess and i linked another table in mysql to ms access, (table2).
when table1 matches the record in table2, it will delete the record in table1.
my query is
delete *
FROM Table1
where table1.artid = table2.artid;
but it always ask me the value of tbl2.artid, the value of tbl2.artid is in the database of mysql and it has already records...
how can i compare the records of table1 (msaccess) and table2 (mysql) and delete the duplicate records?
:D
thanks in advance
Very new to Access and not a VB programmer. :confused:
With that in mind, I have created form for users to record address changes of members. I want to have a button that will "undo" what a user entered if they change their mind/decide an address change not necessary. My address change table has an auto-number field (ID) that is the index and I believe Access automatically creates a record regardless so how do we get rid of it?
I did a search and keep reading about a button wizard - Huh??? I don't know how to activate a button wizard (told you I was new). Also, I read about adding code but to where? and how? It also appeared the code examples might be using psuedo-names for tables or something ... how do I know a "real" name from a psuedo-name?
Can a "Delete" query be written? if so, what is the criteria to use?
I've looked at the properties of the button and all I can see is a place to add a macro or an expression. Am I in the wrong place for what I want to do?
Can anyone offer some help here?
Thanks!
Okay, I want to make a form with a combo box that you can choose a record and click a button to delete it.
As of now I have the records in the combo box but when i can choose a record... i can't delete. and when i cant choose a record.. i can delete. Can anyone help me???? :confused:
I have a subform its not in datasheet view and gives details of bookings for clients.
I am using the on click event of a field and I know that access knows which record I clicked. How do I delete it? which method do I use. can it be done without searching as I know which one i clicked?
regards in advance.
:eek:
I'm hoping someone can help a noob with a simple problem:) I did a search but couldn't find the answer.
When a user clears a record and leaves it Null I would like to prompt them whether they would like to delete the record before the access error message about invalid use of Null comes up. If they don't want to delete the record then the code should undo the change. The problem I have is I can't seem to run my code without the access error coming up. I can't see where I can trap the error (err.Number 3398).
For example, this doesn't work:
Private Sub txtSalesItem_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_txtSalesItem_BeforeUpdate
Dim response as Integer
If IsNull(Me.txtSalesItem) Then
response = MsgBox("Do you want to delete this category?", vbExclamation + vbYesNo, "Delete Sales Item?")
If response = 6 Then
Runcommand acCmdDelete
else
RunCommand acCmdUndo
endif
End If
.
.
.
I know I can put in a validation rule, but I would like to go a bit further.
Does anyone have any suggestions?
How can I delete a record from a form?
I set Allow Datasheet view to yes, Allow Form No, and Allow deletions Yes.
Nothing happens. Perhaps A delete button could be added, but I don't know the code? I do not want to use the Datasheet view as the means of deletion.
Trying to delete a record.
I've read the other posts in this forum about deleting records and I've tried this
Code:Dim intJobID As IntegerDim mysql1intJobID = IDIf msgbox("Do you really wish to delete this Record", vbCritical + vbOKCancel, "Delete Record") = vbOK Thenmysql1 = "delete * from Childrens_list WHERE ID = " & intJobIDDoCmd.RunSQL mysql1PAYP_code = Null 'To bypass an unload procedureDoCmd.CloseEnd IfEnd Sub
on a button event..
where am I going wrong.. Is there an easier form.currentrecord.delete event or something?
Hi,
What's the SQL script for deleting all records in all tables, so without deleting the tables completely,
As I have over 50 tables I do not want to use:
"Delete from TableName"
Is there some wildcard I can use?
Thanks