newcoder1010 Posted October 24, 2017 Share Posted October 24, 2017 (edited) Hi, Every time I create an order I get a confirmation page with the below information. I need to be able to write a function which will return the data I am looking for. How can I write a Function that returns specific data? Data I get after submission:"Student ID: 100 Class ID: 99990444 Teacher ID: 610728"Function Should return "Student ID: 100" after I request for student id. Calling funciton: str = "Student ID: 100 Class ID: 99990444 Teacher ID: 610728" myStudentID = CallFunction(str, "Student ID", "") myClass = CallFunction(str, "Class ID", "") Function CallFunction(completeString, startSearch, endSearch) startPos = InStr(1,completeString,startSearch) CallFunction = mid(CompleteString,startPos,endSearch) End Function Note: Number of digits are unknown for each ID. Also, there is a space after each ID. Above function will not work. I am having trouble how to write the function. Please advise. Edited October 24, 2017 by newcoder1010 Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now