473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

join key of table not in recordset and searchform

Hi

I have a few problems here and hopefully you all can help me.

Basically I will need to create this song database where I can input song fields into the database like artist name, album name etc.

My Relationship is as follow

Record Company ---> Artist ----> Song ------> Album
***************************************** |
*****************************************Genre

Please ignore the asterix

For Record Company:
Record Company ID (Primary Key)
Record Company name

For Artist:
Artist ID (Primary Key)
Artist Name
Company ID

For Song:
Song ID (Primary Key)
Song Name
Album ID
Artist ID
Genre ID
Duration of Song

For Album:
Album ID (Primary Key)
Album Name

For Genre:
Genre ID (Primary Key)
Genre

I created an input dorm which includes

Album ID
Album Name
Artist ID
Artist Name
Genre ID
Genre
Record Company ID
Record Company
Song ID
Song Name
Duration

However, I cant key in information for Artist ID, Artist Name, Song ID, Song Name and Duration.
It gives me the error Cannot add records; Join key of table " " not in recordset. So what can be the problem here?

My 2nd problem is I created a search form with a macro "openquery" linked back to the query which searches for some fields like song name, artists name and genre etc.

My query criteria uses the Forms!Formname!controlset! format

Currently it can only search for one field at a time. So if I want to search for a song which fulfils the Song Name and Artist I which type, the results does not show up correctly. What can be the problem here?
Oct 19 '08 #1
8 2333
Stewart Ross
2,545 Expert Mod 2GB
Hi, and Welcome to Bytes!

If you could post the SQL for your query we will be able to check it out for you.

When a query uses multiple tables joined to reflect the underlying relationships the foreign keys must be from the 'correct' side of these relationships or updating is not possible.

-Stewart
Oct 20 '08 #2
Hi,

But How do i get the SQL out for you to see? Sorry, I am a bit newbie in this
Oct 21 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
From Design View in the Access Query Editor select View, SQL. Select all the text, copy it to the clipboard, paste it into your post, apply the code tags provided in the message editor (to help us see the structure of your post more clearly).

-Stewart
Oct 21 '08 #4
Hi,

I need to create an input form. As such, I have no query. Hence, I am unable to go into the SQL. Do you just want to see the relationship between the different tables?
Oct 22 '08 #5
Stewart Ross
2,545 Expert Mod 2GB
Well, the relationships would at least help - but forms are normally bound to (preferably) a query based on the underlying tables, or one underlying table. Unbound forms can't be used for general data entry and editing, so I'm surprised you are going this route.

-Stewart
Oct 22 '08 #6
Hi,

How do I capture the relationship for you to see?

Hmm.... Can give me an example how do I link it to a query in this case if I wanna make a form
Oct 22 '08 #7
Stewart Ross
2,545 Expert Mod 2GB
The Access Form Wizards will guide you through creating and linking forms to tables or queries. Given that you are clearly at an early stage in understanding Access the best advice I can offer is that you would benefit from reading a good book on Access, or from learning via on-line examples which you may find if you Google search.

The relationships window is not normally capturable in a suitable form for you to post the relationships.

I think it unlikely at this stage that there is much we can do to assist further until you have yourself undertaken basic design and build exercises in Access, particularly regarding tables and table relationships.

-Stewart
Oct 22 '08 #8
Hi...Thanks

Anyway, I have a small problem here. Not sure if you can help me. I created a search form using the query by form method.

I have a few fields to search namely artists, song name etc...When I apply the like parameters to one field using the criteria Like "*" & [Forms]![Search]![Artist] & "*" and I search for partial artist name. It works

However, when I apply the Like parameter across the board to all the fields like song name and genre etc, my search form does not work already. What could be the problem?

This is my query SQL

SELECT Artist.[Artist Name], Album.[Album Name], Genre.Genre, Song.[Song Name], Song.[Year of Release], Song.Duration, [Record Company].[Record Company Name], Song.[Play Song]
FROM Genre INNER JOIN (([Record Company] INNER JOIN Artist ON [Record Company].[Record Company ID] = Artist.[Company ID]) INNER JOIN (Album INNER JOIN Song ON Album.[Album ID] = Song.[Album ID]) ON Artist.[Artist ID] = Song.[Artist ID]) ON Genre.[Genre ID] = Song.[Genre ID]
WHERE (((Artist.[Artist Name]) Like "*" & [Forms]![Search]![Artist] & "*" Or (Artist.[Artist Name]) Is Null)) OR (((Album.[Album Name]) Like "*" & [Forms]![Search]![Album] & "*" Or (Album.[Album Name]) Is Null)) OR (((Genre.Genre) Like "*" & [Forms]![Search]![Genre] & "*" Or (Genre.Genre) Is Null)) OR (((Song.[Song Name]) Like "*" & [Forms]![Search]![Song] & "*" Or (Song.[Song Name]) Is Null)) OR (((Song.[Year of Release]) Like "*" & [Forms]![Search]![Year] & "*" Or (Song.[Year of Release]) Is Null)) OR (((Song.Duration) Like "*" & [Forms]![Search]![Duration] & "*" Or (Song.Duration) Is Null)) OR ((([Record Company].[Record Company Name]) Like "*" & [Forms]![Search]![Company] & "*" Or ([Record Company].[Record Company Name]) Is Null));
Oct 23 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Xenophobe | last post by:
I know this isn't a MySQL forum, but my question is related to a PHP project. I have two tables. table1 table2 "table1" contains 2 columns, ID and FirstName:
0
by: Richard | last post by:
Hi, I work on a VB6 software using ADO to connect to Oracle 9.2i. When I create a recordset based on a query containing a "inner join" clause (sql server syntax, the software connects also...
4
by: Yaron Avior | last post by:
Hi, I have a question regarding join query syntax: In my DB there are Users table, and Transactions table (which has 'TransactionDate' and 'UserName' fields). I would like to display a list of...
7
by: Greg | last post by:
I'm a quantitative securities analyst working with Compustat data (company fiscal reports and pricing feeds). My coworker came across a problem that we fixed, but I'd like to understand 'why' it...
2
by: Lyn | last post by:
Hi, I am opening a form in Continuous mode to list the records from a recordset created in the calling form. The recordset object is declared as Public and is set into the new form's Recordset...
0
by: Sky | last post by:
Hello: Have a nagging question about creating disconnected DataSet queries... If you have a table called INodes of 10,000 records, and a Table called Clients of again 10,000 and a table called...
5
by: mail | last post by:
Urgent help needed! I moved an application from ASP+ACCESS to ASP+MS SQLSERVER and I have the following problem: If the join on two tables results on duplicate colum names (which appear in...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
1
patjones
by: patjones | last post by:
Hi: I am attempting to pull a backend table into a local recordset, make some changes to it, and commit the changes back to the table. I'm using an ADO recordset in Access 2007. The backend...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.