Value lookup by record number

G

Gurtz

Hi Andy,

I don't quite understand what you are trying to do.. are
you trying to query the database for a specific field and
store it in your form (perhaps in a textbox)? Post back
with a better description of your problem and someone will
respond.
:)
Gurtz
[email = no $]
 
A

Andy Korth

Thanks for the help Gurtz,
I've got a set of about 1400 records. Using the
recordsource of the form, I add something like:
WHERE ((([Operation ID Listing].Operation)='Planting'));
Now, I'm down to about 100 records. Only those Planting
records are shown- and this part works great.

Now, I'd like to figure out which Farming Plots were
Planted. I have records 1 - 100, and I'd like to be able
to extract these values and store them in an array with
100 elements. I know how to deal with arrays, but I don't
know how to pull out those Plot numbers.

DLookup doesn't seem to be the answer right now, because
I can't increment by records. I'd like to be able to say
Give me the value in the Plot field for record 1, then 2,
then 3... etc.

I hope this is clearer- any ideas?
-----Original Message-----
Hi Andy,

I don't quite understand what you are trying to do.. are
you trying to query the database for a specific field and
store it in your form (perhaps in a textbox)? Post back
with a better description of your problem and someone will
respond.
:)
Gurtz
[email = no $]
-----Original Message-----
Hello all,
I am trying to do something pretty simple. I've got a
form with a recordsource with an SQL WHERE in it.
I want to be able to take the value of a field in record
number 5 and store it in a variable. i just don't know
the command for this.
DLookup isn't it- it will find records that match a
criteria. This isn't what I want. I'd like a specific
record.

If anyone has any ideas, I'd be happy to hear them,
Thanks,
Andy
 
A

Andy Cole

Andy

Elwin's post will do what you originally asked for. Having read your
response to Gurtz you need to use a variation on Elwin's post;

Dim rst As DAO.Recordset
Dim intI As Integer
Set rst = Me.RecordsetClone
With rst
.MoveLast
.MoveFirst
For intI = 1 To .RecordCount
arrPlots(intI -1) = ![Plot Field]
.MoveNext
Next intI
End With
rst.Close
Set rst = Nothing

HTH

Andy

Andy Korth said:
Thanks for the help Gurtz,
I've got a set of about 1400 records. Using the
recordsource of the form, I add something like:
WHERE ((([Operation ID Listing].Operation)='Planting'));
Now, I'm down to about 100 records. Only those Planting
records are shown- and this part works great.

Now, I'd like to figure out which Farming Plots were
Planted. I have records 1 - 100, and I'd like to be able
to extract these values and store them in an array with
100 elements. I know how to deal with arrays, but I don't
know how to pull out those Plot numbers.

DLookup doesn't seem to be the answer right now, because
I can't increment by records. I'd like to be able to say
Give me the value in the Plot field for record 1, then 2,
then 3... etc.

I hope this is clearer- any ideas?
-----Original Message-----
Hi Andy,

I don't quite understand what you are trying to do.. are
you trying to query the database for a specific field and
store it in your form (perhaps in a textbox)? Post back
with a better description of your problem and someone will
respond.
:)
Gurtz
[email = no $]
-----Original Message-----
Hello all,
I am trying to do something pretty simple. I've got a
form with a recordsource with an SQL WHERE in it.
I want to be able to take the value of a field in record
number 5 and store it in a variable. i just don't know
the command for this.
DLookup isn't it- it will find records that match a
criteria. This isn't what I want. I'd like a specific
record.

If anyone has any ideas, I'd be happy to hear them,
Thanks,
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top