Access functions

G

Guest

What I am doing is creating a database of advertising pieces sent to me by
our financial advisors. What I would like is, when I enter the advisor's
name in the "name" column, to have it automatically search the column of 150
names (our top advisors) to see if the name I typed is found, and if so, then
put an "X" in the "Top Advisor" column.

I think that it needs to be a function, but I have no idea how to create it.
I'd appreciate any help offered.

Thanks Alot!!
 
S

strive4peace

Hi Jay,

you could use an Update Query

'~~~~~~~~~~~~~~~~
dim s as string
s = "UPDATE tablename " _
& " SET [Top Advisor] = 'X' " _
& " WHERE [AdvisorName] = '" & me.controlname & "';"
currentdb.execute s, dbFailOnError
'~~~~~~~~~~~~~~~~

where me.controlname is the control where you put the advisor name --
probably an unbound combobox so you can get the name right ;)

this code would go on the AfterUpdate event of the combobox

you could expand it to include a MsgBox with Yes/No buttons to verify
this is what the user wants to do (but that can get annoying <g>)

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

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

Similar Threads

help with formulas??? 2
need help simple formula 0
Totaling in Reports 1
Looking for an Access Template 5
Auto Create Folders 2
Email Using Continuous Form 1
Report Combining Totals....Help!! 1
Excel Is this possible?? 3

Top