VBA changing the current record

ArthurSG

New member
Local time
Today, 04:49
Joined
Apr 19, 2010
Messages
5
Hello all,

I've only recently started working on access and even more recently started to dab into the VB reference of access.

Here is the setting. I have a comboBox to which the recordSource is an SQL statement that sorts through a table finding the Name, Phone# and ID of a client. The form i am working on is used to append the table that this SQL statement is based on.

I would like for this comboBox to change the Record i am currently working on. Almost like a lookup or search to find any previously entered record and make updates to it.

Im still not sure if i should even use VB or if it could be done using a query. If anything i would at least like to be able to display exactly which record # that client resides under.

Thank you,
ArthurG
 
Well i found the answer to my own question on another website.

http://www.mvps.org/access/forms/frm0005.htm

It was a bit easier then i was making it out to be. But im not sure i fully understand whats going on in this code.. and if someone would be able to elaborate and explain to me the process thats going on it would be greatly appreciated.

Thank you,
ArthurG
 
The code just uses the findfirst method to look for the item you've requested. If it finds it then it sets the form's bookmark (which is the location of the record). By setting the bookmark the record is selected.
 
I get it now.. i was under the impression that i was looking for a record but it was the bookmark i was looking for.
 
Well, sort of. The findfirst looks for the field that is specified (the PK value usually) and once it finds that number it moves to that using the bookmark of that record.
 

Users who are viewing this thread

Back
Top Bottom