One to Many relationship not working, please help :( (1 Viewer)

krissyk775

New member
Local time
Today, 06:44
Joined
May 14, 2020
Messages
3
I need to create one to many relationships between staff, rates, clients and categories - billing. Every time I try and create them it says "Relationship must be on the same number of fields with the same data types" and I have no idea what this means!!
 

Attachments

  • Kelland_Assignment5.accdb
    756 KB · Views: 338
  • accesssnip.JPG
    accesssnip.JPG
    104.6 KB · Views: 355

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:44
Joined
May 7, 2009
Messages
19,233
StaffID in Staff table is Long Integer, while on Billing it is Short Text.
 

plog

Banishment Pending
Local time
Today, 05:44
Joined
May 11, 2011
Messages
11,638
You've made that mistake in other places as well:

Billing.ClientID, Billing.RateID, BillingStaffID are text, should be number
Billing.BillingDate is Text, should be date

You need to use the correct data type for your data.
You should make your autonumber fields primary keys. Right click and then click on "Primary Key" in design view of the table.
And only use alphanumeric and underscore characters in table/field names. That means no spaces (e.g. [Postal Code] = [PostalCode])
Lastly, tables with only 1 real data field (autonumbers don't count as real data) shouldn't exist. Your Rates table should go. Instead of storing the RateID value in Billing you just store the actual rate value.
 

krissyk775

New member
Local time
Today, 06:44
Joined
May 14, 2020
Messages
3
You've made that mistake in other places as well:

Billing.ClientID, Billing.RateID, BillingStaffID are text, should be number
Billing.BillingDate is Text, should be date

You need to use the correct data type for your data.
You should make your autonumber fields primary keys. Right click and then click on "Primary Key" in design view of the table.
And only use alphanumeric and underscore characters in table/field names. That means no spaces (e.g. [Postal Code] = [PostalCode])
Lastly, tables with only 1 real data field (autonumbers don't count as real data) shouldn't exist. Your Rates table should go. Instead of storing the RateID value in Billing you just store the actual rate value.







Hi!!
thank you so much for the help! I fixed all of these errors but I'm running into a different problem now :( I have attached the new document and a screenshot of the error I'm receiving
 

Attachments

  • accesssnip2.JPG
    accesssnip2.JPG
    111.1 KB · Views: 331
  • Database4.accdb
    536 KB · Views: 238

plog

Banishment Pending
Local time
Today, 05:44
Joined
May 11, 2011
Messages
11,638
Ok? The error tells you the issue.
 

plog

Banishment Pending
Local time
Today, 05:44
Joined
May 11, 2011
Messages
11,638
Define fixed it. What did you do?

I opened the most recent database you posted and the issue was there.
 

mike60smart

Registered User.
Local time
Today, 11:44
Joined
Aug 6, 2017
Messages
1,908
Hi

I added an Eighth Client to the Client Table and you can now set the relationships between Clients & Billing
 

Attachments

  • Database4.zip
    28.4 KB · Views: 325

Users who are viewing this thread

Top Bottom