Reading from File

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
 
Assuming that you're in the correct forum (Access), I'm guessing that you are very, very entry level. Not putting you down, you understand, but "files" aren't used to store db data in Access, tables are. Not knowing this makes me think you're very new to Access. Basically what you need to do is set up the proper relationship between your various tables, then base your form on a query that includes all of the appropriate fields from these tables. Once this is done, you can refer to the fields and manipulate the data to your hearts content.

Hope this helps. It sounds to me like you're coming to Access from another Programming Language. Doing what you were speaking of was actually the way databases where written prior to RDBM systems. Access and others programs have streamlined the programming tremendously, but you really do have to get the very basics down first or you'll find yourself drowning.

Good Luck.

The Missinglinq
 

Users who are viewing this thread

Back
Top Bottom