It's not really a code problem. It's actually a problem knowing which buttons to push (so-to-say) to get the result I want. I actually figured it out, but deleted the project where I was testing thinking I'd get back to it the next day. Then work happened bla. Been out of town for 2 weeks and can't remember what I did. Anyway I'll figure it out again.
I think I had to make a new view or something of the such in SQL Server then use...
User Profile
Collapse
-
ComboBox problem
Hi all. I am using VS2008 Pro. I have a simple DVD database built. I'm trying to make a data driven app to store my dvd collection.
One of my tables is Actors and is structured as follows.
ActorID - int - PK
LastName - varchar(20)
FirstName - varchar(20)
On a form in my app I have a combobox. I'm trying to make it list FirstName LastName ie. Will Smith. I know how to make a query that'll... -
Actually I am going to use the ActorID as the search instead of the name. Just wanted to see where I was going wrong on the DISTINCT thing. Using WHERE does sound a lot more sensible though. Thanks for the direction. Also thanks for the info on the aliases. That does indeed looks like it'll make things look cleaner.Leave a comment:
-
Oh geesh that was easy.
Thank you very much for your assistance.
Another thing I'm trying to accomplish is this...
I've been trying to figure out how to use the DISTINCT function. Say I'm searching for all movies I have with Will Smith. If I have 3 of the main actors listed under each movie it lists them each 3 times. Here's the query I'm using to list the movies.
Code:SELECT TOP (100) PERCENT
Leave a comment:
-
Quary Confusion
I have the following tables and fields.
Actors
-ActorID
-LastName
-FirstName
Movies
-MovieID
-MovieName
-Year
.
.
.
Genres
-GenreID
-Genre
Ratings
-RatingID
-Rating
MoviesActors
-MovieActorID
-MovieID
-ActorID
I figured out how to do the joins... -
Is this the right path?
OK I have the following table structure. Is this considered normalized?
dbo.Movies
MovieID - int - PK - IsIdentity (true)
MovieName - varchar(100)
RatingID - int - FK to Rating table
ActorID - int - FK to Actors table
MoviePic - varchar(50) - stores path to picture file ie. \movie.jpg
Description - text
GenreID - int...Leave a comment:
-
OK I'm totally confused after reading that article lol.
From the article I clearly see it's bad to have Actor1 Actor2 etc etc on my Movies table.
When I search for the movie I want it to display 3 or 4 of the leading actors plus other data such as rating and running time. The actors bit is what confuses me though as it's bad mojo to have Actor1 Actor2...
I see I could also have a problem with the Actors...Leave a comment:
-
Database normalization question
I was going to make a database to store a list of my DVD's. I have a question about the table structure though.
I want to have some fields for actors. I'm thinking 4 or 5 would be plenty. From what I understand it wouldn't be proper to have fields like Actor1 Actor2 and so on. As I would want to be able to search for a movie based on an actor, how would I structure my tables for this and keep things normalized? I was thinking perhaps... -
-
Yeah I was getting an error, but I managed to fix it and get the thing working. Thanks for taking a peek over my code though :)Leave a comment:
-
Actually I figured out another way to do it with the following code. If anyone else is trying to do something like this here's a nice easy way.
Code:Dim strSQL As String 'String for the INSERT SQL statement Dim strInputIndicator As String 'String to store the indicator letter Dim strInputDesc As String 'String to store the Description of the indicator DoCmd.SetWarnings False 'Don't display
Leave a comment:
-
The ReQuery command will be the last line of my code. I can't figure out all the lines that would come before that. How do I accept a value from the form via an input box, then pass that variable to a query, then lastly I will update the listbox via the ReQuery command.
In a nutshell how would I get the data from the form to the table?Leave a comment:
-
INSERT using a variable
I'm having a bear of a time here. I have a table that I want the user to be able to insert new data into (this new data will only be 1 letter). Anyway I've made a small query that accepts an @variable. When I run the query I get an input box asking me for the variable and inserts my data into the table like it should.
Where my problem arises is I need to be able to let the user click a button, enter the desired data into an input box,...
No activity results to display
Show More
Leave a comment: