473,657 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Edit or manipulate tables using a button in the GUI (code issue)

3 New Member
I'm trying to create a button on my GUI that will access a table or query I have created elsewhere and change all of the values of one field to "off".
I use this application to create reports based on the options I select but need to reset them occasionally with out resetting the whole form to its original state.

The only code I have tried so far is;

Expand|Select|Wrap|Line Numbers
  1.     For Each Value In Table.Table1.Selected
  2.         Set Value = Null
  3.     Next 
and this hasn't worked, I'm showing you just so you can get a better idea of what I'm trying to accomplish.

Thanks
Sep 22 '10 #1
5 1950
gnawoncents
214 New Member
It might be easiest to create an update query to set the field to "off" and then run the query when you press the button.
Sep 22 '10 #2
Clubsandwich
3 New Member
So this update query will be able to reset a field in a different query/field?
Sep 22 '10 #3
Mariostg
332 Contributor
Yes.
The generic form is
Expand|Select|Wrap|Line Numbers
  1. UPDATE tableName SET fieldName='off' WHERE fieldName='on'
  2.  
This would set to off all values that are on in field fiendName
Sep 22 '10 #4
Clubsandwich
3 New Member
I like the sounds of this but I'm still confused about some logistics.
Where would I use the code you provided?
How do I create an "update query" and link that to happen when a button is pressed?
I'm fairly new to access...
Sep 22 '10 #5
gnawoncents
214 New Member
It can be done in embedded SQL or by creating a query object (perhaps the easiest way if you're just starting).

Start by creating a regular query and select the table/item to modify.

Click the button to change it to an update query.

Add the data you want updated in the "Update To" area and add any criteria in the "Criteria" field.

Save the query and note the name.

You can run the query from a button. The easiest way to set this up is use the button wizard, select the Misc. category and then "Run Query" from Actions. Then select the query you just created. When you press the button it will run the query. If needed, you can remove the warnings with the setwarnings = false, then turn them back on with true later.
Sep 22 '10 #6

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

Similar topics

1
1838
by: donhyams | last post by:
It seems like at one time I knew how to do this, but right now I'm drawing a blank. I know there has to be an easier way to link tables using more than one field. Heres a simplfication of the problem: I have two tables that are not normally linked to each other: ------------ tblClientStatusDetails with these fields: ...ClientStatusID = Autonumber (Primary Key)
0
2005
by: Patrick.O.Ige | last post by:
I have a datagrid with checkboxes.. When a user clicks one check box and clicks the delete button it deletes that ROw. There another situation when a user clicks multiple rows so i had to loop throug the rows like so:- foreach (DataGridItem i in DataGrid1.Items) { CheckBox deleteChkBxItem = (CheckBox) i.FindControl ("DeleteRow"); if (deleteChkBxItem.Checked) {
13
6774
by: ricky.agrawal | last post by:
I'm really not sure how to go about this in Access. What I've created is a table for each location. Those tables are identical in format but different in information. The tables are named after key points such as the store number and the store ID. The fields of those tables are generic fields such as sales per day, bank deposit and what not. The first field for each store table is the date and I've set that as the primary key as one...
1
2971
by: SDRoy | last post by:
Hi I am using asp:BoundField code for my GridView Control. Something like: <asp:GridView ID="GridView2" runat="server" AutoGenerateEditButton="True" OnRowEditing="GridView2_RowEditing"> <Columns> ............................ ............................
0
1417
by: anwarulhuq | last post by:
I have placed Edit-Update-Cancel Link button from Properties builder of the Data Grid. Its working but the problem what im facing is.. It doesnt work till i click for two times. Link button should work for only one click right. Please help me out to solve this.
1
1853
by: Rendrick | last post by:
I am using a form called EnterData to input data into a table and I am having issues getting the Form to link properly. I open EnterData in another form called NewReport. In NewReport I use the following code: Dim stDocName As String Dim stLinkCriteria As String stDocName = "EnterData" Forms!EnterData.RecordSource = "SELECT * FROM Employee10" DoCmd.OpenForm stDocName, , , stLinkCriteria
2
7597
by: rameshgohil | last post by:
I am using grid view and a button column in it using <itemTemplate> but I am not able to rerive cell value of a selected row from grid view. I have tried the following to methods in Row_command event of gridview but it gives Null reference exception error while clicking the button in button column of grid view : int index = gdvOdetails.SelectedIndex; object oid = (object)gdvOdetails.SelectedDataKey.Values; txtMsg.Text =...
7
11076
dmjpro
by: dmjpro | last post by:
Hi All .... I am trying to edit a file using RandomAccessFile. I am having a little bit problem. My file is ... i m debasis jana.
4
2420
by: sriharsha | last post by:
how to edit a photo in database? using PHP code
2
3518
pbala
by: pbala | last post by:
Hello, I am using MSAccess 2003 Database which contains tables and some forms. I want to hide the tables and form code from some users.Only developer will going to view this. How did I hide the tables and code from users while at Run time. Now user will view my code and open the data tables freely. How can I avoid this? Please help me
0
8421
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, 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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
jinu1996
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8621
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.