473,289 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Need to click button twice

1
I'll start by apologising, i'm a newbie and a self taught one at that. That aside, I've put a button on a form and I'm having to click it twice before it posts the record, any suggestions how to fix this (or how to improve what I'm doing? I'd be extremely grateful for any input.

Private Sub Command156_Click()

On Error GoTo HandleError


Dim dbs As Database

Set dbs = OpenDatabase("Pets2nd")

dbs.Execute " INSERT INTO PetDetails " _
& "SELECT * " _
& "FROM [PetDetailsEntry];"

Dim rst As Recordset

dbs.Execute "DELETE * FROM " _
& "PetDetailsEntry WHERE PetTagNo <> null;"

dbs.Close

MsgBox "Everything posted okay!"

Me.Refresh
Me.Requery

HandleExit:

Exit Sub

HandleError:

MsgBox Err.Description
Resume HandleExit

End Sub
Nov 25 '22 #1
0 6733

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

Similar topics

2
by: Danny Wang | last post by:
HI, I have a dialog (window) with a drop-down list and an OK button. When user clicks the drop-down list, the app need to do some calculation and validation, so I put an Text_on_change event on...
3
by: Wang | last post by:
Here is the code for a webcontrol, quite simple: ------------------------------------------------------------------------------------------------------------- <%@ Control Language="c#"...
0
by: Diffident | last post by:
Hello All, I have an asp:button and I have tied an eventhandler to this button's click event which means that the eventhandler should be executed everytime I click the button. But to my...
1
by: Zamael | last post by:
Okay... I've got a web app built in .NET 2.0 and for some reason I have to click a LinkButton twice in order for it to work. What's interesting is that the first URL reads as follows:...
0
by: =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= | last post by:
I'm having trouble working with a Summary Validation control. I need to click my submit button twice for the Summary to display when validation errors occur on the page. Background: My page...
4
by: leafboy75 | last post by:
Bit of a strange one. A Label will not update to show how manay records have been found, unless I click the button twice. Anyone know why Code below Private Sub storesrch_Click() Dim...
1
Tarantulus
by: Tarantulus | last post by:
Hi Guys, I'm creating a simple shopping cart app. I have a button which launches $PHP_SELF? followed by variables (product id, qty, price etc) the cart works fine, apart from updating the...
3
by: newlearner | last post by:
Hi All I have an interview question What will happen if i click the submit button twice in a JSP. Will the second request be processed or not. Thanks new learner
18
by: julietbrown | last post by:
Can you boost my understanding of Access? I don't like things I can 'cure' but don't understand why! I've converted the Save macro on my form to VBA. It looks like this ... as I'm sure you...
2
by: Pamr | last post by:
My site is programmed with php and javascript. I have a search button which it searches records from my database. I have two different programming codes into the same file which retrieve data, the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

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.