473,406 Members | 2,745 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,406 software developers and data experts.

Update Table Based on Textbox Values From - To

Dears,
The idea is that I'm trying to update all the records of the table based on From - To numbers, CmdUpdate on Click Event to update the table, please note that I need to filter for certain location before updating, and previous month data to be kept so where in another table for future reference, I have 5 different locations that r to be updated frequently on monthly basis, the amount of data are about 300,000 records. Attached image 4 more clarification. Thanks

Nov 15 '15 #1
6 3842
zmbd
5,501 Expert Mod 4TB
My advise is to make a copy of your database before doing any of the following.

using the copy, you can transfer this method to working file after you've refined the method.
1) Create a simple select query that will return a set of records that match those that you will be updating. This will ensure that only the intended records will be affected in the update step.

2) Create a parameter based select query out of the query developed in step 1 - in the above link there are several options. Personally I would use the form method. Use a control for your "from_id", one for "to_id", and a third for your update value... this will be used once your select query is returning the correct records.

3) Once your select query is returning the correct record set. Change it to an update query, insert the third control name in to the query as done with the first two.

+ Your image in dropbox is not showing and I am currently on an unblocked PC.
Please use the advanced posting option to upload the image to the post.
Nov 15 '15 #2
Thanks for the support, but steps 2 & 3 are a bit confusing me. I'm attaching sample Database, the cmdUpdate is to update both ReceivedDate and MothOfIssuance columns under tblMontlhlyData, hope I'm not make confusion or mixing up the thinks. Regards
Attached Files
File Type: zip UpdateTable.zip (52.6 KB, 174 views)
Nov 16 '15 #3
zmbd
5,501 Expert Mod 4TB
Oh, thank you for the database; however, I am currently working on a restricted network - thus, unable to d/l files for now.

I'm sorry, I reviewed the link for the tutorial and they are using the silly macros instead of VBA. The link used to lead to a fairly straight forward tutorial - but MS has "updated" things again :)

However, the basic concepts to place the form name and control name in the query for the WHERE criteria and then again for the update value still hold true.

I see that you are using an on_click event in a command button to trigger the task, so I'll work with things from there; however, before we go too much farther how much experience do you have with Access and VB.

Once I have that information I can work up an example for you that you should then be able to take the concepts and apply them to your situation.

-z
Nov 16 '15 #4
Okay no worries, I'm good in access and VB, u can go ahead and start working up the example. One question if u don't mind, what do u mean by silly macros instead of VB? as I'm using macros frequently in in my database.
Once again thanks for the support
Nov 17 '15 #5
zmbd
5,501 Expert Mod 4TB
Ok,
Because that last link has changed so much from the simplistic methodology. Attached is an example database that walks thru the steps I mentioned in post#2 and the tutorial.

I've tried to keep it simple; however, there is one form that has some bells-n-whistles. Keep in mind that I've bodged this out in a short time frame so it's not totally polished, my intent here to provide some examples.


++ as for macros... they are good for what they can do and in very specific situations such as for the autoexec, autokeys, navigation-control-form-tiered-controls-with-split database, and sharepoint/webapps are the only way to go; however, you'll find that VBA is generally a much more robust environment for application development.

+ Just for clarity, although VB and VBA are cousins, there are some differences in how they handle different situations; however, that's another thread topic altogether! :)
++ and related, in Access the Macro language is a different beast from VBA. Although in Excel, Macro and VBA are used interchangeable - leading to a lot of confusion when one moves from Excel/Word to Access.


BOL
Attached Files
File Type: zip 964850_UpdateQueryBasedOnForm.zip (94.5 KB, 198 views)
Nov 18 '15 #6
Much appreciated, I got the idea but still need to do few changes to adapted to my database, regarding the VB I will further explore the topic, I know most of the basics and very familiar with it but not really detailed one.
Thanks
Nov 19 '15 #7

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

Similar topics

3
by: takilroy | last post by:
Hi, Does anyone know of a simple way to do this? I want to create an insert trigger for a table and if the record already exists based on some criteria, I want to update the table with the...
2
by: Mike Leahy | last post by:
Hello all, This question is related to updating tables - is there any way to calculate or update the values in a column in a table to the values in a field produced by a query result? An...
7
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL...
1
by: Andre Ranieri | last post by:
Hello, I'm trying to set up an ASP.NET 2.0 form where the user enters values in WebControls.TextBoxes for amount owing, interest and late fees and a JavaScript function totals the three values...
1
by: Rajasuds | last post by:
I have a question in MS Access I have two tables MASTER with Fields 1, Field 2, Field 3 TRANS with Field1, Field 2, Field,10 I need to set up a look up condition where, I need !Field 2 to...
1
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i...
1
by: abinesh.agarwal | last post by:
Hi , I want to update the column in a table based on the updation of the other column in the same table, but not getting the desired result. DDL: CREATE TABLE .( NULL,
1
by: zoeb | last post by:
Currently I have a table, and would like the calculate a field in the table by referencing values from another 3 tables. i.e. tblData Index1, Index2, Index3, Value 1 2 3 2...
0
by: perdijc | last post by:
The wizard to create dataset, automatically creates a method to update table if the dataset is based on table. If i create a dataset based on sotored procedure where this is based on more one...
3
by: rahul2310 | last post by:
i have table consider table 1 which contains employee code which is unique and date of leaving and there is another table consider table 2 where employee code is foreign key and contains Date of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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...

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.