FootballGuy
New member
- Local time
- Today, 14:32
- Joined
- Apr 10, 2004
- Messages
- 5
Entry level questions contd. - reading from files
READING FROM FILES OTHER THAN THAT FROM THE FORM
OK, I am embarassed to ask this, but how do I do read from a file that is not the file used for data entry on the form.
Sample scenario:
Form (file: MovieRental) - Movie Checkout processing
- a field on the form is a drop down of the movie title (it shows the movie names from the file Movie, and on pick updates MovieRental.MovieID)
- AfterUpdate of that drop-down list I want to read the "Movie" file and get access to the Movie.Producer and Movie.Year field for display and other use.
- I am guessing its along the lines of creating a new object linked to the "movie" file then doing a read using the movie field along the lines of, in the AfterUpdate:
Dim aMovie as Movie = new Movie
Read aMovie where aMovie.MovieID = MovieRental.MovieID
- from there I am assuming I can use the aMovie record anywhere else in the code. Also, I guess I would declare the object at the beginning of all code so I could use it everywhere.
That of course did not work at all.
Thanks in advance
READING FROM FILES OTHER THAN THAT FROM THE FORM
OK, I am embarassed to ask this, but how do I do read from a file that is not the file used for data entry on the form.
Sample scenario:
Form (file: MovieRental) - Movie Checkout processing
- a field on the form is a drop down of the movie title (it shows the movie names from the file Movie, and on pick updates MovieRental.MovieID)
- AfterUpdate of that drop-down list I want to read the "Movie" file and get access to the Movie.Producer and Movie.Year field for display and other use.
- I am guessing its along the lines of creating a new object linked to the "movie" file then doing a read using the movie field along the lines of, in the AfterUpdate:
Dim aMovie as Movie = new Movie
Read aMovie where aMovie.MovieID = MovieRental.MovieID
- from there I am assuming I can use the aMovie record anywhere else in the code. Also, I guess I would declare the object at the beginning of all code so I could use it everywhere.
That of course did not work at all.
Thanks in advance