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

storing access query result in variable

hello

i have a table..

in that there are three columns "motor id" "voltage" and "current"


i want to select voltage of motor whose id is 10
so query will be

select voltage from table1 where id = 10


my question is how to store output of this query to any variable ??
so that i can apply formulas on result.

please help me i am not able to write code
Aug 6 '12 #1
3 2559
Hi Prasad

define your Variable
Open a recordset based on your query
assign the value of voltage to your variable
close and destroy the recordset
Aug 6 '12 #2
please tell me code i am using access 2007
Aug 8 '12 #3
zmbd
5,501 Expert Mod 4TB
prasad joshi

Most of us are not going to provide a coded solution until you've posted your efforts. I'm sure that you'll understand why once you've read thru: http://bytes.com/topic/access/answer...-posting-forum
http://bytes.com/topic/access/answer...tting-question
It is all too easy to have students ask questions and get the answers to their homework.

John gave you a very good outline for solving this using a record set. This would be a good method if the database is large.

However, for smaller databases, and simple code, returning only one or two lookup-ed values I would suggest the DLOOKUP method. http://support.microsoft.com/kb/208786
Yes... it's for 2000 however the syntax didn't change.

Please take a hand at writing the code...
Once you have it... post it here to let us know if you've succeded or you need more help.

-z
Aug 8 '12 #4

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

Similar topics

3
by: Jack | last post by:
Hi, I have a form when loaded, retrieves record from an access table. Among other fields there is a check box called FinalUpdate. This is tied to a field in Access of type Yes/No. The form...
8
by: s_wadhwa | last post by:
SELECT DISTINCTROW "01C" AS dummy, Buildings.BuildingNumber, UCASE(Buildings.BuildingName) AS BuildingName, Buildings.MasterPlanCode, Buildings.UniformBuildingCode,...
1
by: echazin | last post by:
I have created a form that contains several different queries. The queries are simply linked to a command buttons, so all the user has to do is click on the desired query and the result set window...
19
MSeda
by: MSeda | last post by:
I would like to use a Global variable as a criteria in an access query. in my first attempt to do so I wrote a Function that looks like this Public Function GloVar(ByVal VarName) As String ...
1
by: RookieDan | last post by:
Greetings fellow Accessers! Im new but in Access, but I have some background in different coding. I have a programme loading customer data into Access belonging to BMW dealers in Europe. ...
1
by: Deepalis | last post by:
Can we pass a variable in any access query?I am stuck in a VBA code where I am passing variable from excel and using Access Queries to extract Data from Linked Table.This query works in Access but...
1
by: dougmeece | last post by:
Good Morning Everyone, I had a idea that I woulld like to pose to the forum. I have no idea if this is possbile but from what I could find searching it does not appear to be. I created a...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
1
by: pretzelboy | last post by:
Hi, I last wrote software 13years ago in the pascal, dbase, clipper days. I have recently built a Ubuntu Box and with C++ (and help from the web) setup a serial barcode reader program using Mysql...
1
by: ZAVILA | last post by:
This is the SQL code for starters. SELECT DISTINCTROW .CYCLE_DATE, .SERIES_NBR, .SERVICER_NBR, .SERVICER_NAME, .SERVICER_LOAN_NBR, .LOAN_NBR, .INTERNAL_LOAN_ID, .ARCC_LOAN_NBR, .LIEN_STATUS_CODE,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.