473,387 Members | 1,771 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,387 software developers and data experts.

Update Query from Form

12
Hi,

I want to make a form for Update Query to update order dates.

As you know Query update requires:

Criteria = Old Date
Update to: New Date

but i want it to get both old and new dates from a form.

I think, you can get what i want to achieve.

thanks in advance for your replies.
Jan 11 '14 #1

✓ answered by zmbd

Here's how I "cheat" on that.

Make a copy of the data in question. (NEVER EVER work with the production file NOR the only copy of the data!!!!)

Now, using the standard Query editor, build you select query to return the records you want to update. Run this and make sure that the records you want for a single instance are returned.
Convert to the update query.
enter your update values, etc...
save
run
double check that this updated the desired records.
Switch to SQL view
And now you have the basic SQL script.

You can use parameters at this point or you can use the form and pull that information from the form and build a SQL to use with the execute method.

I'm going to send you to MS for a tutorial for how to:
Use parameters in queries and reports

You should be able to modify the saved query.

Once you have this working in the copy of your database... simply import it into the production database!

4 8207
zmbd
5,501 Expert Mod 4TB
Here's how I "cheat" on that.

Make a copy of the data in question. (NEVER EVER work with the production file NOR the only copy of the data!!!!)

Now, using the standard Query editor, build you select query to return the records you want to update. Run this and make sure that the records you want for a single instance are returned.
Convert to the update query.
enter your update values, etc...
save
run
double check that this updated the desired records.
Switch to SQL view
And now you have the basic SQL script.

You can use parameters at this point or you can use the form and pull that information from the form and build a SQL to use with the execute method.

I'm going to send you to MS for a tutorial for how to:
Use parameters in queries and reports

You should be able to modify the saved query.

Once you have this working in the copy of your database... simply import it into the production database!
Jan 11 '14 #2
nomeepk
12
@Zmbd thanks a lot for giving me the idea.
You are always the best.

i have attached two pictures.

here what i have done. what you do you think about that?

http://flic.kr/p/j81Aw4

and

then created a button and used this code, got this basic code from a page and used it here:

http://flic.kr/p/j81Aza
Jan 11 '14 #3
zmbd
5,501 Expert Mod 4TB
Sorry, third party sites are not usually available to me when at work, nor to a large number of the experts. If you'd like to upload them here then use the advanced button under the post window, manage attachements, and upload the image to your bytes.com profile.
Jan 11 '14 #4
nomeepk
12
Here both code and query?

well it seems its working, not through form fields but...
Attached Images
File Type: jpg code.jpg (16.1 KB, 578 views)
File Type: jpg querry.jpg (24.0 KB, 525 views)
Jan 12 '14 #5

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

Similar topics

1
by: Kunal | last post by:
Hi, I need some help on writing an update query to update "UnitsSold" field in Products Table whenever I save a transaction. The transaction may contain several "Subtransactions", one for each...
5
by: Don Seckler | last post by:
I have an update query that runs when a report closes. I have several reports that will need to run the update query with diferent criteria. I'd like to simply make the criteria change in the...
0
by: Dalan | last post by:
I'm not certain if this is doable in the manner explained below, but I'm certain that there have been Access developers who have done something similar. So whatever insight and assistance that can...
6
by: Nicolae Fieraru | last post by:
Hi All, I was trying to update a field in a table, based on the results from a query. The table to be updated is tblCustomers and the query is qrySelect. This query has two parameters, provided...
5
by: Andrew | last post by:
I've got a list box that selects a record on a subform, and in that subform are a few text fiels and a button that runs an update query. How do I have the update query button run and only update...
15
by: Darren | last post by:
Help, i want to run an update query from a form.. and was wonderin.. Can the update query run if i want to update a value manually inputted from a form (e.g. !!) to a table...
4
by: jofo | last post by:
Hello all, I have project form and an hours form and related tables for each. The project table has a status flag to determine if the project is open or closed. When a user enters hours on a...
1
by: Eric | last post by:
I create an extra field in the table, bind it to the relevant form (as in normal form design). Then to show the data. I want to run an update query on the table so that the data posted by the...
12
by: praveenkrg | last post by:
my update query is not working properly! $mgroupname=$_GET; //echo $mgroupname; ///query for checking userg_id $result=mysql_query("SELECT * FROM group WHERE userg_name ='$mgroupname'");...
2
MindBender77
by: MindBender77 | last post by:
Hello again, All... Admin's, I wasn't sure where to post this, please move if in wrong forum. I'm using FrontPage 2003 to post form data to a second form to be used in an update query. The query...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
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...

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.