verify user input

  • Thread starter Thread starter danny_chev
  • Start date Start date
D

danny_chev

Hi
I have a very simple Infopath form in which the user types in their
name and id number, which will concatinate to show them what their user
name will be in another text box on the form.

We have a separate exel sheet with the pre-setup usernames.

I would like a bit of script to take the contents of the text box in
infopath and verify that the exel spreadsheet includes a cell with that
content and if it does, show a "succesful" message or if it doesn't
exist show a "try again" message to the user.

Does anyone have any suggestions please?

Thanks alot

Dan
 
Dim v, res
v = "Valuetocheck"
res = application.Match(v,Worksheets("sheet1").Range("A1:A500"),0)
if iserror(res) then
msgbox "No match"
else
msgbox "Match"
End if
 

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

Back
Top