getting a String from a Table?
-
Hello all, I have what I hope is a quick question. In my Access 2000 database I have a Table called Candidates. In this table there is a Field called LName. How can I get the data in this field without opening the table? This what I am trying to do. In the Main Form of my database, you can eneter a Last Name and hit the Command button and it will open the Candidate Table to the first occurence of the person with that last name. I'd like to write an autofill ability in the Main Form. This way when I type A into the space where you type in the last name, it will automatically fill the text to Aardvark for instance. And then if I hit another letter, like b and the string in there is "ab" it would return the first last name with Ab, for instance Aba. Now, I know the logic behind how to do what I want, but I need the syntax. How can I make a string equal the text in the last name field? Would it be: Dim lastName as String lastName = [Candidate].[LName] ?? Any help you can offer me would be great. And one more quick question. Is there a way to access the characters in a string? Can I type lastName[1] and get the first letter of the string? Again thank you very much. Nick
-
Hello all, I have what I hope is a quick question. In my Access 2000 database I have a Table called Candidates. In this table there is a Field called LName. How can I get the data in this field without opening the table? This what I am trying to do. In the Main Form of my database, you can eneter a Last Name and hit the Command button and it will open the Candidate Table to the first occurence of the person with that last name. I'd like to write an autofill ability in the Main Form. This way when I type A into the space where you type in the last name, it will automatically fill the text to Aardvark for instance. And then if I hit another letter, like b and the string in there is "ab" it would return the first last name with Ab, for instance Aba. Now, I know the logic behind how to do what I want, but I need the syntax. How can I make a string equal the text in the last name field? Would it be: Dim lastName as String lastName = [Candidate].[LName] ?? Any help you can offer me would be great. And one more quick question. Is there a way to access the characters in a string? Can I type lastName[1] and get the first letter of the string? Again thank you very much. Nick
Anonymous wrote: How can I get the data in this field without opening the table? :confused: Aaaaaa you can't. You have to at least open it to run a querry on it and get the data out.
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.