newbie question

Agent_J

Registered User.
Local time
Yesterday, 19:39
Joined
Mar 28, 2004
Messages
20
I'm trying to create a table so that when you enter data, its a pull down menu so you just select when you want instead of typing it. For example, the Fields are Movie, Actor and Movie Genre and for Movie Genre, you can then select Science Fiction, Action, Comedy, Romance, Horror, etc... which i typed in another table.
 
Last edited:
Combo Box

Hi,
Ya you can do that. Put a combo box on your form. Then in the properties of the combo box go to data. In data set the "Row Source Type" to Value List. Then set Row Source to the values that you want and seperate each value by a semicolon. So it would be like {SciFi;Horror;Biography;etc.} Hope this is what you are looking for.

Joel
 
hi jazz, would it possible to do that in a table too?
 
Not Sure

Sorry, I'm not sure. I guess it could be but I just about always use forms. Sorry I can't be more help on that one.
 
Agent_J said:
hi jazz, would it possible to do that in a table too?

Most definately-- You can do that with a table too.

Just as jazzscreamer said..

1) Put a combo box on your form
2) Goto the combo boxes properties Data tab
(This is where it differs.)
3) Change Row Source Type to Table/Query.
4) Then set Row Source to something similar to: SELECT [tblMovies].[Genre] FROM [tblMovies]
5) Enjoy! :)

The above example would mean the table you are using is called tblMovies... and the field with all the genre's in it is called Genre

Write back with an update. Have fun!
 
Another note.. if you have a table that already has a bunch of movies entered with all their information. You wouldn't have to create a new table just to list the genres.

If you have a table something like this already..
(Example)
(title)Star Trek (genre) science fiction
(title)Star Trek II (genre) science fiction
(title)Star Trek III (genre) science fiction
(title)Star Trek IV (genre) science fiction
(title)Star Trek V(genre) science fiction
(title)Star Trek VI (genre) science fiction
(title)Rambo (genre) Action
(title)Rambo II (genre) Action
(title)Rambo III (genre) Action
(title)Rocky (genre) Action
(title)Rocky II (genre) Action
(title)Rocky III (genre) Action
(title)Rocky IV (genre) Action
(title)Halloween (genre) Horror
(title)Halloween II (genre) Horror
(title)Halloween III (genre) Horror
(title)Halloween IV (genre) Horror
(title)Halloween V (genre) Horror

.. you get the point, eh? You could create a query that will create a list or table that would just be "Science Fiction, Action, Horror" instead of having 6 Science Fiction, 7 Action, & 5 Horror. (I'm sure your list would have a ton more :p) Food for thought. Good luck!
 
o1110010 said:
... You wouldn't have to create a new table just to list the genres.

Now that I think about it. It would be a good idea to have a table just for the available genre's. Then you could use it as a Row Source when you enter more movies to your database. And Limit to List to prevent spelling goofs.

Anyways.. hope the three posts don't bother ya. ;)
 
Ohh! Just joined the forum? Welcome! Hope you visit often. :D

o1110010 said:
... Anyways.. hope the three posts don't bother ya. ;)

Make that four posts. :o
 
^^^

ya, that's exactly what im trying to do o1110010 :) , but i cant seem to get it to work, how would i make it a row source :o ?

edit: this is to post 7, and thanks for welcome ;)
 
Last edited:
Agent_J said:
^^^

ya, that's exactly what im trying to do o1110010 :) , but i cant seem to get it to work, how would i make it a row source :o ?

edit: this is to post 7, and thanks for welcome ;)

One minute while I whip up an example. Please.
 
Here ya go. Check out the attachment. You can even start using that and add to it. Whatever you want. :)

Edit: Oh.. It's an Access 2000 database. Is that what you are using? It should work in anything but Access 97. :eek:
 

Attachments

Last edited:
omg how did u do that? :eek:

i just don't get how u did this part:

relationship.jpg
 
Agent_J said:
... i just don't get how u did this part:

You can do it too! Quite simple really. Click the line inbetween the objects (tables in this case) and click DELETE.

1) Click txtGenre (from tblGenre) & hold the button down.
2) Drag it over to txtGenre (in tblMovies) and let go.
(A window will pop-up.)
3) Check Enforce Referential Integrity.
4) Click Create.

(It is a ONE-TO-MANY relationship because txtGenre is the primary key of tblGenre while txtMovie is the primary key in tblMovies.)

Presto! Done. :D

Understand what's going on elsewhere in that file? Any questions before I head to bed? :p
 
so do u create the form first or the relationship first :o ?
 
Last edited:
create the tables and set the relationships first. search here for cascading combos, there have been several examples posted
 
Agent_J said:
so do u create the form first or the relationship first :o ?

The relationship is not needed to perform this task you started the thread for. In this instance, a relationship just helps speed up the database a teeny tiny bit.

I did create the relationship first though.. just good practice to create a relationship as soon as you have related data and unique identifiers.
 
oh one more thing

"SELECT tblGenre.txtGenre FROM tblGenre;"

Could u could explain that :o ?
 
Agent_J said:
oh one more thing

"SELECT tblGenre.txtGenre FROM tblGenre;"

Could u could explain that :o ?


Sure! It's saying "I want (select) data from the tblGenre table but I only want everything in the field txtGenre."

Those types of statements can get pretty long at times. That probably is the simplest they come. However most I use don't get incredibly long.
 
oh i finally got to work :D

now i know why i hate programming lol
 

Users who are viewing this thread

Back
Top Bottom