PC Review


Reply
Thread Tools Rate Thread

Can I do a lookup??

 
 
Bob Howard
Guest
Posts: n/a
 
      14th Aug 2008
I'm not particularly adept with DAO, so this has been a stretch...

I'm trying to loop thru each record in a particular table to set the
contents of a field (let's call it Field A and which is currently unused) to
a set of values based on certain conditions. This field is a boolean.

The records also contain a FieldB, which is a string and which can contain
only three values (H, O or I).

The records also contain a FieldC, which is a "long". The records in the
table are "grouped" in that all records containing the same value in FieldC
are associated with one another.

A particular group will contain either one "H" record or one "O" record.
The rest of that same group will consist of zero or more "I" records.

The logic to determine whether to set it true or false is roughly as
follows:

If FieldB equals "H" or "O", then I want to set FieldA (the previously
unused field) to true.

This part is working.

Here's the part that I can't figure out...

If FieldB equals "I" (the only other valid value in this application), then
I need to see if that record is associated with an "H" record or an "O"
record.

I've tried using DCount and DLookup with no success because the program I'm
running is part of a front-end and the database I'm "converting" is a
backend somewhere --- and I have no link to the backend (I just get to is
via DAO).

Is there something in DAO similar to the DCount or DLookup? I don't really
need to see the associated record(s) --- just whether there's an "H" or "O"
associated with my record.

Does any of this make sense?? Or am I making it more complicated than
necesssary??

bob



 
Reply With Quote
 
 
 
 
Bob Howard
Guest
Posts: n/a
 
      14th Aug 2008
I got it figured out...

I needed to bookmark the current record location and then do a movefirst to
try and find a matching record. After checking for nomatch, I then used the
bookmark to return to the prior location. And to make all this work, I has
to specify dynaset in the openrecordset.

Many attempts --- but it finally worked!

thanks for your patience with this dunderhead!

bob

"Bob Howard" <(E-Mail Removed)> wrote in message
news:ePvdJHa$(E-Mail Removed)...
> I'm not particularly adept with DAO, so this has been a stretch...
>
> I'm trying to loop thru each record in a particular table to set the
> contents of a field (let's call it Field A and which is currently unused)
> to a set of values based on certain conditions. This field is a boolean.
>
> The records also contain a FieldB, which is a string and which can contain
> only three values (H, O or I).
>
> The records also contain a FieldC, which is a "long". The records in the
> table are "grouped" in that all records containing the same value in
> FieldC are associated with one another.
>
> A particular group will contain either one "H" record or one "O" record.
> The rest of that same group will consist of zero or more "I" records.
>
> The logic to determine whether to set it true or false is roughly as
> follows:
>
> If FieldB equals "H" or "O", then I want to set FieldA (the previously
> unused field) to true.
>
> This part is working.
>
> Here's the part that I can't figure out...
>
> If FieldB equals "I" (the only other valid value in this application),
> then I need to see if that record is associated with an "H" record or an
> "O" record.
>
> I've tried using DCount and DLookup with no success because the program
> I'm running is part of a front-end and the database I'm "converting" is a
> backend somewhere --- and I have no link to the backend (I just get to is
> via DAO).
>
> Is there something in DAO similar to the DCount or DLookup? I don't
> really need to see the associated record(s) --- just whether there's an
> "H" or "O" associated with my record.
>
> Does any of this make sense?? Or am I making it more complicated than
> necesssary??
>
> bob
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup help. lookup result based on data in 2 columns lcc Microsoft Excel Worksheet Functions 3 6th Apr 2010 01:20 PM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Microsoft Excel Misc 5 26th Jun 2009 09:15 PM
Access 2003 Lookup based on Lookup previous field - populate other records on Form janine_docsonline Microsoft Access Forms 0 29th Jan 2006 10:03 AM
Lookup field versus lookup table?? and sorting?? =?Utf-8?B?SlIgSGVzdGVy?= Microsoft Access Database Table Design 1 4th Nov 2005 08:39 PM
Lookup formula returning same value for multiple lookup values wellsrp Microsoft Excel Discussion 3 10th Oct 2005 05:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:02 PM.