473,729 Members | 2,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

saving [enter a value] in update query

Hello.

No one in the queries newgroup answered this question. I hope someone here
can. Thank you. Stuart

The following Update Query allows my users to substitute a numerical value
for the phrase "Allele 2" in the field Taqcall. This is run from a command
button on a form for the table:

UPDATE tblSEQTAQ AS A SET A.taqcall = [Enter a Value for Allele 2:]
WHERE (((A.taqcall)=" Allele 2"));

I would like to display the value entered to replace "Allele 2" in the
table. That is if the user changes all of the "Allele 2" values to the
number "1," then I want to have the number 1 displayed on the form next to
a caption that reads "Allele 2."

TIA for your help.

Sincerely,

Stuart E. Wugalter
Statistician II
Building: PMB B100
Mail Code: 9011
Department: Zilkha Neurogenetic Institute
Division: Keck School of Medicine
Telephone: (323) 442-1080
FAX: (323) 442-3054
E-Mail: wu******@usc.ed u

Nov 12 '05 #1
1 1948
dp
I get around this problem of asking for values twice for parameters in
queries with global variables. Here is what I do: I have module with
public code in it.

global savedVar as string
-----------------------------------------------------------------
public function savedVarReturn( ) as string
savedVarReturn = savedVar
end sub
-----------------------------------------------------------------

BEFORE you start to run the query, do an

savedVar = inputbox("What is the value of the parameter?")

Now you have the value in "savedVar" which is global, you can reference it
straight from code, or, if you want to retrieve the value for a query
parameter, as the criteria of that field, put the return function in the
criteria... Since it doesn't change, you can use it for a second, and third
query as well.

savedVarReturn( )

Remember, you must have filled in savedVar before you call the function from
within the query.

-Brian
"Stuart E. Wugalter" <wu******@usc.e du> wrote in message
news:c1******** **@gist.usc.edu ...
Hello.

No one in the queries newgroup answered this question. I hope someone here
can. Thank you. Stuart

The following Update Query allows my users to substitute a numerical value
for the phrase "Allele 2" in the field Taqcall. This is run from a command
button on a form for the table:

UPDATE tblSEQTAQ AS A SET A.taqcall = [Enter a Value for Allele 2:]
WHERE (((A.taqcall)=" Allele 2"));

I would like to display the value entered to replace "Allele 2" in the
table. That is if the user changes all of the "Allele 2" values to the
number "1," then I want to have the number 1 displayed on the form next to a caption that reads "Allele 2."

TIA for your help.

Sincerely,

Stuart E. Wugalter
Statistician II
Building: PMB B100
Mail Code: 9011
Department: Zilkha Neurogenetic Institute
Division: Keck School of Medicine
Telephone: (323) 442-1080
FAX: (323) 442-3054
E-Mail: wu******@usc.ed u

Nov 12 '05 #2

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

Similar topics

4
5454
by: Jacob H | last post by:
Hello list... I'm developing an adventure game in Python (which of course is lots of fun). One of the features is the ability to save games and restore the saves later. I'm using the pickle module to implement this. Capturing current program state and neatly replacing it later is proving to be trickier than I first imagined, so I'm here to ask for a little direction from wiser minds than mine! When my program initializes, each game...
3
1845
by: Stuart E. Wugalter | last post by:
Hello All! I have a button on a form that is tied to the following query: UPDATE tblSEQTAQ AS A SET A.taqcall = WHERE (((A.taqcall)="Allele 1")); The user looks at the form and decides to assign a code for the text Allele 1. It works fine.
9
7026
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have it return the associated records to a listbox. Once the listbox has the records, I want to select a record, which will open a form associated with the selected record in the listbox.
2
14876
by: lgo | last post by:
I have read several variations of this topic posted on this news group. However I was not able to find the answer for my problem. I am trying to build code (see below) to update a large single record using data from a temporary (editing) table with identical field structure. I iterate through the fields (some 50 of them) with a For Each - Next loop to update each field with the SQL statement. The updating works fine with numeric data type...
13
7409
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've created forms for both those tables, and inserted the child table form into the master table form as a subform. It works just as it is supposed to, in that I can create a new master record, and then add detail records.
2
1252
by: NCrum | last post by:
I have a DataGrid bound to an Access 2K database entering a time in the grid either via a DatetimePicker or directly into the field the time displays Ok on the grid but will not update the database using a DateTimepicker I can see that the value is a string all types in code and XML schema are dateTime, I have saved the time back to a string field OK 2 date/time fields formatted dd/mm/yyyy HH:mm in Access - same problem when formatted...
5
3064
by: mimo | last post by:
Hello, I have seen samples on how to pull data from one table and save back to it using the Form View control. How do I pull from multiple tables and save back to multiple tables on one screen? Is there a sample of this somewhere? For example I want to create a Name and an Address from one screen. It has to create a Name Record, a Name Address Record, and a NameAddressJoin Record.
6
4931
by: Paul Furman | last post by:
I'm getting incorrect response when hitting the enter key instead of actually clicking the button on a form. It activates but the post data isn't being sent I think. The php generated page flickers & reloads but doesn't perform the update. This is php generated, I'm just pasting the page source (reformatted & extra junk removed and I think they are now identical), and it's running on my localhost apache server for testing so maybe...
0
1544
by: Magnus Bergh | last post by:
I am developing an application for pocketpc and this involvs a but of juggling with different forms. I have an "order entry" type of application. On the main form I have a grid which displays Order headers. Let call this form "OrderList" From this view I edit/enter new orders by opening a new form for entering data. This is done using (more or less) the designer generated forms, so I have a "Order edit view dialog. I pass the binding...
0
8761
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
9280
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...
1
9200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8144
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...
0
6016
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
4525
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
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
2677
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.