473,503 Members | 722 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 1938
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
1830
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...
0
1998
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...
13
6753
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...
1
2964
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"> ...
0
1409
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...
1
1835
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...
2
7572
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...
7
11043
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
2412
by: sriharsha | last post by:
how to edit a photo in database? using PHP code
2
3514
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...
0
7339
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...
1
6995
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
7463
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
5581
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,...
1
5017
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...
0
4678
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
3168
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...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
738
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.