Hi Guys
I have form which displays information for 4 different tables, It is actually based on a query.
I have Tab Control in my form, for each Item in the form I have 2 tabs.
Tab1 shows detail-1, tab2 shows detail2.
I want to be able to delete detail-1 or detail-2 for each item, or add a new detail.
Can any one help?????
THanks
8 1512 NeoPa 32,564
Recognized Expert Moderator MVP
I have Tab Control in my form, for each Item in the form I have 2 tabs.
Tab1 shows detail-1, tab2 shows detail2.
I have no idea what you're referring to here.
What does 'each item' mean?
Can you make your question clearer so that someone can give you an answer.
I have no idea what you're referring to here.
What does 'each item' mean?
Can you make your question clearer so that someone can give you an answer.
By item i meant application.
For each application I have 2 TabControl (2 windows) called Server and Contacts.
In Tab Server I have displayed Server (where application is located), Server Description and the location of server.
In tab Contacts, I have displayed information like department and contact details for that application, (information of the person to contact to when an application is broken or needs to be updated)
Now the location of the application (the server it was located in) has changed and also the department and the contact details has changed too therefore I need to delete them of the table and insert a new information instead.
I have 2 buttons "Delete" and "Add New" in each of the window (Tab) which should perform delete and insert operation on the tables.
I need help performing these operations.
I hope this is clear enough.
Thanks
By item i meant application.
For each application I have 2 TabControl (2 windows) called Server and Contacts.
In Tab Server I have displayed Server (where application is located), Server Description and the location of server.
In tab Contacts, I have displayed information like department and contact details for that application, (information of the person to contact to when an application is broken or needs to be updated)
Now the location of the application (the server it was located in) has changed and also the department and the contact details has changed too therefore I need to delete them of the table and insert a new information instead.
I have 2 buttons "Delete" and "Add New" in each of the window (Tab) which should perform delete and insert operation on the tables.
I need help performing these operations.
I hope this is clear enough.
Thanks
I have send this email a while ago and still didn't have any response.
I just want to know how to Insert or delete from a table using SQL statment in VBA.
MMcCarthy 14,534
Recognized Expert Moderator MVP
I have send this email a while ago and still didn't have any response.
I just want to know how to Insert or delete from a table using SQL statment in VBA.
OK Tara
Basic syntax ... -
Dim strSQL As String
-
-
' To delete a record
-
strSQL = "DELETE * FROM TableName WHERE [ID Field]=" & Me.[ID Field]
-
DoCmd.RunSQL strSQL
-
-
' To insert a record
-
strSQL = "INSERT INTO TableName (Field1, Field2, Field3) " & _
-
"VALUES (" & Me.textbox1 & ", " & Me.textbox2 & ", " & Me.textbox3 & ");"
-
Mary
NeoPa 32,564
Recognized Expert Moderator MVP
I have send this email a while ago and still didn't have any response.
I just want to know how to Insert or delete from a table using SQL statment in VBA.
Tara,
Two things :
1. Please don't complain about any delays in responding to posts. We have a bunch of experts on here who choose to spend their time helping you and others like you in their free time. It is entirely inappropriate for you or anyone else to complain that they are not quick enough or even, if I'm to be honest, that they may choose not to respond to any individual request at all. As helpers I am happy for any of them to make that choice. They very rarely do thank goodness (if you look at some of the post times you'll see that great efforts are made already just to keep up with as much as possible).
(Moderator hat on).
2. If you tell me which version of Access you are running I will tell you how to find some very interesting information on SQL commands that are usually difficult to find when going the normal ways through help. I've had to do it for '97 through 2K3 and managed to get there on all so far, but sometimes after a lot of very counter-intuitive searching.
Tara,
Two things :
1. Please don't complain about any delays in responding to posts. We have a bunch of experts on here who choose to spend their time helping you and others like you in their free time. It is entirely inappropriate for you or anyone else to complain that they are not quick enough or even, if I'm to be honest, that they may choose not to respond to any individual request at all. As helpers I am happy for any of them to make that choice. They very rarely do thank goodness (if you look at some of the post times you'll see that great efforts are made already just to keep up with as much as possible).
(Moderator hat on).
2. If you tell me which version of Access you are running I will tell you how to find some very interesting information on SQL commands that are usually difficult to find when going the normal ways through help. I've had to do it for '97 through 2K3 and managed to get there on all so far, but sometimes after a lot of very counter-intuitive searching.
Hi NeoPa
Thanks for raising this point and please don’t get me wrong, I am not complaining at all. I am thankful and I really do appreciate the efforts that all the experts make to answer our question.
I am aware that there may me delays or the expert may not even want to answer any question, I understand that completely.
There are many new developers like me who want their questions answered, and because of that the thread may be forgotten.
So instead of creating a new thread for the same question I have just replied to my self to bring it on the top of the list and get attract the experts attention and that was all.
I am running 2002 version of Access at work, and 2003 at home.
Thanks
OK Tara
Basic syntax ... -
Dim strSQL As String
-
-
' To delete a record
-
strSQL = "DELETE * FROM TableName WHERE [ID Field]=" & Me.[ID Field]
-
DoCmd.RunSQL strSQL
-
-
' To insert a record
-
strSQL = "INSERT INTO TableName (Field1, Field2, Field3) " & _
-
"VALUES (" & Me.textbox1 & ", " & Me.textbox2 & ", " & Me.textbox3 & ");"
-
Mary
Thank you Mary
That is all I needed.
NeoPa 32,564
Recognized Expert Moderator MVP
Tara,
Thank you for your reply - very clearly and nicely put.
I have to look out for such things as a moderator as we feel it's important to protect all our experts and make them know we value them all highly :).
I'm not trying to sound grumpy - honest.
In future, just post something like 'Bumping Thread' - that's what we all do when we feel the need (not too many times though).
-Adrian.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Someonekicked |
last post by:
I have a binary file, and I need to delete a specific number of characters
in it.
The file contains records, each record has a specific length.
So the way I wanna handle deleting is that I will overwrite the record I
want to delete with the last record in the file, then actually delete that
last record in the file. the problem Im having is...
|
by: Robert Schneider |
last post by:
Hi to all,
I don't understand that: I try to delete a record via JDBC. But I always
get the error SQL7008 with the error code 3. It seems that this has
something to do with journaling, since the table from which I want to
delete has two foreign keys that references two other tables and it is
also referenced by another table. But this...
|
by: Steve |
last post by:
I have several pairs of synchronized subforms in an application. I have a Delete
button for each pair that uses the following code or similar to delete a record
in the second subform:
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True
End If
ExitHere:
Me!SubName.SetFocus
|
by: Uwe Range |
last post by:
Hi to all,
I am displaying a list of records in a subform which is embedded in a
popup main form (in order to ensure that users close the form when
leaving it).
It seems to be impossible to delete a record in this subform.
When I switched modal off and tried to delete a record from the list,
I deleted a record on another form (below the...
|
by: Maria |
last post by:
Is there another way to delete the current record in a subform from the main
form, another subform or a sub-subform other than setting focus on a field
in the subform and using run command acCmdDelete Record?
Thanks!
Maria
| |
by: Susan Bricker |
last post by:
I have a command button on a form that is supposed to Delete the record
being displayed. The record is displayed one to a form. The form is
not a Pop-Up nor is it Modal. Tracing the btnDelete event routine shows
that AllowDeletions is TRUE.
When the Delete button is clicked (without TRACE ON), I get a 'beep',
the recordselector (vertical...
|
by: Bob Bridges |
last post by:
Start with two tables, parent records in one and child records in the other,
a one-to-many relationship. Create a select statement joining the two.
Display the query in datasheet mode. When I delete a row, only the child
record is deleted from the source tables; the parent record is still
there...which is what I wanted.
Now display fields...
|
by: Craggy |
last post by:
Hi,
I am trying to pop up a yes/no message box so that a user can delete a record in a continuous form. The default delete message is a bit sloppy because it seems to move the continuous form to the position of the record u want to delete. If you then choose to not to delete the record it looks to a user as if it has deleted every record before...
|
by: sh26 |
last post by:
I can Add and Delete (A, CName, MX and TXT) Dns records on the Dns Server using C# code. The problem I am having is if someone manaully creates a TXT record on the Dns Server, I cannot delete that particular record using the same C# code. Here is what I am using to delete the records:
public void DeleteRecord(string domain, string recordName,...
|
by: beacon |
last post by:
Hi everybody,
This is probably going to sound unorthodox, but I have to log records that are deleted...I know, go figure.
Anyway, I have a form with a (continuous) subform, and on the subform I have a command button, called cmdDelete, that launches a dialog form, called frmDeleteCurrentRecord, where the user has to enter their name and a...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |