How can I check whether the data is in the table or not with VBA?

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi,

Hope someone have quick answer to my question.

I have a table call "IssueTable". I want to code to find out whether the
user inputed informaiton is in the IssueTable before user enter it in the
table.

I don't want to duplicate the issue in the issuetable. Therefore, I want to
check it before I enter it as new item.

In the Usertable, there is the Authrization# field and if user enter part of
Authrization#, I want the code to check if the User input is in the Issue
Table.

Thanks
 
Use DLookup(). For examples, see:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html

Something doesn't feel quite right though. In general, you would want to
design your tables so there's only one table where all the authorization
numbers go.
 
Richard, I'm not sure I understand this question. What language do you speak
normally? If you write it your native language, assuming it's not something
exotic like Serbo-Croation or Turki, I might understand it better. Or you
could re-try English, just rephrasing it.

To save time, I'll guess (but I don't guarantee I'll guess right): If
you're trying to prevent Issues from being entered in the Issue table more
than once, why not design the Issue table to forbid duplicate keys?
 
Back
Top