473,770 Members | 4,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating query running from form

I have this update query

UPDATE [Storage Box Inventory] LEFT JOIN [Box Number/Contents Table] ON
[Storage Box Inventory].[Box Number]=[Box Number/Contents Table].[Box
Number] SET [Box Number/Contents Table].[Storage Date] = [Storage Box
Inventory].[storage date]
WHERE [Storage Box Inventory].[Box Number]=[Box Number/Contents
Table].[Box Number];

Which updated the storage date for all linked data with the similar box
number. Now I want to create a SQL that will run on a form command or
afterupdate.

The SQL above updates all data, I only want to update the date related
to the box number opened under the form. Ideally, access updates the
data (or something like that) after inputting the correct date under
the Storage Box Inventory form.

thanks,

danthrom

Jul 24 '06 #1
2 1501

danthrom wrote:
I have this update query

UPDATE [Storage Box Inventory] LEFT JOIN [Box Number/Contents Table] ON
[Storage Box Inventory].[Box Number]=[Box Number/Contents Table].[Box
Number] SET [Box Number/Contents Table].[Storage Date] = [Storage Box
Inventory].[storage date]
WHERE [Storage Box Inventory].[Box Number]=[Box Number/Contents
Table].[Box Number];
AND [Storage Box Inventory].[Box Number] = me.cboboxnumber

you need to add a filter for the single record you're trying to update.
you need a [fieldname] = the open form's related field.

then assign that stuff to a button on your form.

docmd.openquery "qupd..."

If it's in a canned query, you can just point at the open form. (then
you need to use

=Forms![formname]![controlname]

Jul 25 '06 #2
Thanks,

you answered my question and it works well.

danthrom

pi********@hotm ail.com wrote:
danthrom wrote:
I have this update query

UPDATE [Storage Box Inventory] LEFT JOIN [Box Number/Contents Table] ON
[Storage Box Inventory].[Box Number]=[Box Number/Contents Table].[Box
Number] SET [Box Number/Contents Table].[Storage Date] = [Storage Box
Inventory].[storage date]
WHERE [Storage Box Inventory].[Box Number]=[Box Number/Contents
Table].[Box Number];
AND [Storage Box Inventory].[Box Number] = me.cboboxnumber

you need to add a filter for the single record you're trying to update.
you need a [fieldname] = the open form's related field.

then assign that stuff to a button on your form.

docmd.openquery "qupd..."

If it's in a canned query, you can just point at the open form. (then
you need to use

=Forms![formname]![controlname]
Jul 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2958
by: | last post by:
Hello, Sorry to ask what is probably a simple answer, but I am having problems updating a table/database from a PHP/ PHTML file. I can Read From the Table, I can Insert into Table/Database, But not update. Here is a copy of the script I am using. I do not know what version of MySQL my host is running nor do I have Shell Access to it. I
11
16226
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have...
3
2485
by: Ryan.Chowdhury | last post by:
This is a general question regarding the use of view and stored procedures. I'm fairly new to databases and SQL. I've created a SQL database using an Access Data Project ("ADP") and I'm satified with the table structure. I've moved on to building some front ends for our users. I'm running into situations where I want subreports to be built from queries that are dependent on the values in other controls. I've played with stored...
1
2324
by: Derek Davlut | last post by:
I have a Table that contains data that I use in a query to manipulte the data through expressions. I have a form that uses the query for manipulating the data. How do I write the changed values back to the table from the form? I know it changes the query values so do I have to use an update query? I also need this to be refreshed in realtime. I have tried relationships but I find it adds a drop-down box to the table and is not really what I...
3
5006
by: MLH | last post by:
I have a form, bound to a query. Its RecordSource property is a query named frmEnterLienAmounts. The form has a few bound controls and some unbound controls. The unbound controls are calculated fields whose DefaultValue property is set to something like DLookUp("","tblVehicleJobs","=Forms!frmEnterLienAmounts!VehicleJobID") The form (frmEnterLienAmounts) has, as one of its bound fields . As I scroll through the records, one-
2
1314
by: Jaaz | last post by:
Essentially I'm constructing a database to track a lot of data. Part of this included a running history table that is linked to data outside the table. On the main form I used, I've hit a snag. I want to be able to show on the form if the company entered (each w/different ID tag) and the table holding info regarding licenses (linked through company's ID) has the 'active' checked, when it is filtered by the project number just entered...
15
7376
by: sara | last post by:
I have a Memo field in a table to hold notes from a conversation a social worker has had with a client (this is for a non-profit). If the user needs to update the memo field, I need to find the original record (which I am doing fine - getting the correct key) and I need to update the "notes" with the new value from the form, which I store in a String Variable. (I've tried storing in a Variant variable; didn't work for me)
1
1576
by: Arnold | last post by:
Greetings, I have a form, frmProgressReports, with qryProgressReports as the recordsource. A field in the query is named 'Select" and is yes/no, with criteria set to true. This filters the form so that only students who are in a teacher's class are available in the form. At the top of the form is an unbound combobox, cboStudents, used to quickly navigate to a student's records. The reason it is unbound is because there are a couple...
3
1797
by: Spoogledrummer | last post by:
Hi it's me again, still working on the sam 5 minute problem so feeling kind of thick now. I've dumped the idea of using a textarea for now and am using a textbox instead but am struggling when it comes to updating the database, I've tried several different methods and the one I'm currently battling with is as follows: % set objconn=server.CreateObject("ADODB.connection") objconn.Mode=3 objconn.Open ("DSN=localserver; User ID=blah;...
0
9602
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
9439
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
10237
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8905
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
7431
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
6690
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.