Connecting Tech Pros Worldwide Help | Site Map

Find or look up record

Newbie
 
Join Date: Mar 2007
Posts: 5
#1: Mar 27 '07
I have a table with Coloms :

CardID : Timein : Bookstaken : Timeout : Booksback

When a person comes in his
card_id number is filled in to the field "cardid"
Time in = "now()"
Bookstaken is also filled in.
After update the form closes.
A couple of record can be made before the person leaves and give the books back.

I want to have a new form with a unbound text box which will search for the last record containing that specific Card Id number.
The rest of the record will then be filled in.
i.e.. Timeout = now()
I tried a number of "find" codes but none seems to work the way I want it to.
Rabbit's Avatar
Expert
 
Join Date: Jan 2007
Location: California
Posts: 3,835
#2: Mar 27 '07

re: Find or look up record


Quote:

Originally Posted by Digitallad

I have a table with Coloms :

CardID : Timein : Bookstaken : Timeout : Booksback

When a person comes in his
card_id number is filled in to the field "cardid"
Time in = "now()"
Bookstaken is also filled in.
After update the form closes.
A couple of record can be made before the person leaves and give the books back.

I want to have a new form with a unbound text box which will search for the last record containing that specific Card Id number.
The rest of the record will then be filled in.
i.e.. Timeout = now()
I tried a number of "find" codes but none seems to work the way I want it to.

An unbound text box can't really search for the last record containing a specific card id number. Unless you mean you want that unbound text box to concatenate every field in the record, which I doubt. So I'm thinking you want to return a specific field from the record.

Also, I assume the last record of a card id number will have the most recent Time In.

So, you'll want to use a DLookup to look up the field you want and a DMax as part of the criteria to get the last record.
Newbie
 
Join Date: Mar 2007
Posts: 5
#3: Mar 28 '07

re: Find or look up record


Quote:

Originally Posted by Rabbit

An unbound text box can't really search for the last record containing a specific card id number. Unless you mean you want that unbound text box to concatenate every field in the record, which I doubt. So I'm thinking you want to return a specific field from the record.

Also, I assume the last record of a card id number will have the most recent Time In.

So, you'll want to use a DLookup to look up the field you want and a DMax as part of the criteria to get the last record.

If I lookup the record will I be able to edit the rest of the blank records?
and what will the code look like?
I will see if I can work it out myself as well.
Thanks for the Info!!!
Rabbit's Avatar
Expert
 
Join Date: Jan 2007
Location: California
Posts: 3,835
#4: Mar 28 '07

re: Find or look up record


Quote:

Originally Posted by Digitallad

If I lookup the record will I be able to edit the rest of the blank records?
and what will the code look like?
I will see if I can work it out myself as well.
Thanks for the Info!!!

I'm not following.

Are you trying to go to a certain record?
Or
Are you trying to retrieve a specific value from a table?
Newbie
 
Join Date: Mar 2007
Posts: 5
#5: Mar 28 '07

re: Find or look up record


Quote:

Originally Posted by Rabbit

I'm not following.

Are you trying to go to a certain record?
Or
Are you trying to retrieve a specific value from a table?


Hi
What I tried to do was going to a certain record and then enter the new data in to the exsisting record.
i.e. Books out - books back for the spesific id holder.After giving it some thought it might not be such a gr8 idea to edit a exsiting report.Rather make a new record with books back and then reconsile , the books out - books back with a query , sorted by date and card id.
Hope this make sence?! Some time it is easier to plan things in your mind than exsplaning the idea.
The code for finding a record will still be quite usefull in a other aplication though.
Thank you for all your help and time!! Hope I can one day be as help full to others!
Rabbit's Avatar
Expert
 
Join Date: Jan 2007
Location: California
Posts: 3,835
#6: Mar 28 '07

re: Find or look up record


DoCmd.FindRecord will take you to the first occurence of a criteria that you supply. More can be found in the visual basic editor help files.
Reply