473,503 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Record Still Showing in Form Even After Deleted in Code

1 New Member
hello
i m working on my project,someone plz help
i delete record ,after deletion result is saved in database(access),but not in vb form ,when i click on next or previous buuton ,i still see that record in form,and this record remains in form until or unless i reopen the form.
i m using ADODB ,record set and sql query like
Expand|Select|Wrap|Line Numbers
  1. a="delete from addressbook" where name='"& txtname.text *"'
  2.  conn.Execute(a)
Dec 14 '12 #1
4 2127
Seth Schrock
2,965 Recognized Expert Specialist
Just put
Expand|Select|Wrap|Line Numbers
  1. Me.Requery
right after your
Expand|Select|Wrap|Line Numbers
  1. conn.Execute
It will go to the first record in recordset and the deleted record won't be there.
Dec 14 '12 #2
NeoPa
32,557 Recognized Expert Moderator MVP
That code will need to be called from the form that needs to be requeried. This may, or may not, be the same place you are running the SQL code a from.

If it is not then you need :
Expand|Select|Wrap|Line Numbers
  1. Call {Some reference to the form}.Requery()
See Referring to Items on a Sub-Form for help with that.
Dec 14 '12 #3
Seth Schrock
2,965 Recognized Expert Specialist
I guess I did make an assumption there. Good catch NeoPa. One more thing to think about when answering questions.
Dec 14 '12 #4
NeoPa
32,557 Recognized Expert Moderator MVP
Seth:
One more thing to think about when answering questions.
Less straightforward than one might imagine, certainly. You're certainly heading in the right direction though. Welcome on board :-)
Dec 14 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4282
by: David Allison | last post by:
cmdButton to Print 3 copies of record in Form view ? cmdButton will print 1 but I need 3 copies of the one Form record. -- Dave Allison
1
1337
by: bhavik | last post by:
hi I have problem with attachment showing form server side. when our application run on localhost we add any attachment to mail server. if suppose we want to show that attachment we can see...
6
2840
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
8
3850
by: Ragbrai | last post by:
Howdy all, I have a form for entering data (Form A), on which is a cmd button that opens Form B in acdialog mode to allow me to enter/edit records that are being displayed on Form A. After...
1
1549
by: Rathi R | last post by:
Hi, I am new to this forum. I am working on Ms-Access. Based on the data in various tables i am generating a form. In that form, the calculated values have to be displayed one after the other i.e as...
2
10435
by: Tom Clavel | last post by:
Scratching my head. I am using the filter property on a combo box .AfterUpdate event to get to a single client record. This is causing a some strange behavior: As I enter a subform, I get a no...
2
1720
by: Blue10 | last post by:
Hi, I'm new. Many of my old pages get listed on search engines, but once the record they call is deleted the page is no longer available. I was wondering if there was some ASP code for where a...
4
1894
by: leeg | last post by:
Hi all, I am having trouble finding out how to stop a new record showing on my form when there are no records showing in my underlying query Query criteria is populated from a form text box and...
10
10661
by: maxx429 | last post by:
Good day all, Using Access 2007 but DB is created in Access 200o format so I can still use User Level security. I have what am sure is a very newbie question. I want to add a control to a form...
1
1626
by: evildracko | last post by:
first a write error prompt Title: Write Conflict Text: This record has been changed by another user since you started editing it. If you save the record, you will overwrite the changes the other...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.