Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query that returns one number into a variable

Status
Not open for further replies.

DSburgh

MIS
May 19, 2005
26
0
0
US
I have a query returns a single integer that I need to assignt put into a variable.

This doesn't work:
intCurrentUnits = [qry_sum_units_per_com]![SumOfComp_Units_Per_Component]

I have a list box that displays the query also, would it be possible to use CInt() to pull the value from there? I'm sure it's possible but I keep getting 'invalid use of null' error.
 
Silly me, i was using .Value instead of .Column(0,0) [purpleface]

Got it working now
 
Hi!

You can use DLookup:

intCurrentUnits = DLookup([SumOfComp_Units_Per_Component], [qry_sum_units_per_com])

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top