473,748 Members | 8,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table relationships

184 New Member
Hi all

I have been working on this project now for 4 months and is still no further than the first step. This is driving me to suicide.

As a testing database I have set up the following:

Table 1(Clients) :

ClientID
Firtsname
Lastname
HouseNumber
Streetname
Town
Postcode
HomePhone
MobileNumber
Email

Tabel 2(Treatments) :

TreatmentID
Treatment
Cost
Date

Now I am not sure how to relate these tables . I also want to set up a tabbed form and on the first page only enter new client details but then on the second enter any treatments for existing clients. Now how do you link a specific treatment to a client?

After 4 months I should know how to do this, but I think I have gotten myself into such a muddle I dont know left from right and plus we have just upgraded to Access 2007.

Thanks for any advice.
Feb 8 '07
78 5228
bloukopkoggelmander
184 New Member
Neopa

Just to put your worries to rest on that one, I saw that the fields you specified werent the correct ones so I did change it to the correct ones. I will do as you asked with the query and let you know.

Thanks
Feb 14 '07 #31
bloukopkoggelmander
184 New Member
Right

I have done as you asked and created the query and run it. There were no errors and the result it gave me was :

Three fields as follows :
FirstName (It listed all first names of all clients entered into my Clients table)
LastName ( It listed all lastnames of all clients entered into my Clients table)
ClientFull(It listed the concatenated first and lastnames of all clients entered in my Clients tabel)
Feb 14 '07 #32
NeoPa
32,571 Recognized Expert Moderator MVP
So essentially that worked well. That clarifies that point. Thanks for the other post btw - it helps me to focus on what may be a problem, and not waste effort on inconsequential s :)
Now, with this query saved as a QueryDef you need to :
  1. Ensure that it (or a more complex query including both of these fields - FirstName & LastName - tested to return the expected results of course) is used as the source for your form.
  2. When that is done, ensure that the two controls for the First & Last Names are correctly bound to the fields from the QueryDef.
  3. Check that this form returns these two fields as expected.
  4. Update a control (or add a new one) to show the full name as Me![].ControlSource = "=[FirstName] & "" "" & [LastName]".
When you reply - please include the names of all items introduced (QueryDef; Form; All the controls; etc).
Feb 14 '07 #33
bloukopkoggelmander
184 New Member
Morning Neopa

Right I have carried out your instructions, but yet again unsuccessfull. Here is what I have done:


I created a new query(TestQuery ) and included Clients.FirstNa me,Clients.Last Name,Clients.Cl ientFull(Client Full:[FirstName]&" "&[ClientLast]. I then ran this query and it returned all fields with all the relevant data, including the concatenated field with the concatenated names in it.

I then created a new form(TestForm) and based the form Record Source on TestQuery. I then made sure that all items on the form (FirstName,Last Name,ClientFull ) had their Control Source set to the corresponding fields that the form is based on. I then tested the form and now no values were displayed for either FirstName,LastN ame,ClientFull.

I then updated the control as you requested and tested it again . This time FirstName and LastName were still left blank, but ClientFull had #Name? displayed in it.




As for your 4 points on post #33 :

1. The query I created and tested returned the correct values beofre bounding it to any form.
2. The two controls for the First & Last Names are correctly bound to the
fields from the QueryDef.
3.The answer is no as no values are returned this time.
4.Before updating the control, all fields on the form are blank.After updating the control I recieve #Name? for ClientFull with FirstName and LastName still empty.


I hope this is comprehensive enough, if not then please let me know.

Thanks
Feb 15 '07 #34
bloukopkoggelmander
184 New Member
I've done it!!

I have open TestForm end edited the properties for ClientFull.

I left Control Source empty.
For RowSource I entered the following : Select TestQuery.Clien tFull AS ClientFull From Testquery.

On the form now I get a dropdown box with all the concatenated names listed and I am able to select which one I need.

All I have to do now is to get it to work on the form I am planning to set up.
Feb 15 '07 #35
NeoPa
32,571 Recognized Expert Moderator MVP
As for your 4 points on post #33 :

1. The query I created and tested returned the correct values before binding it to any form.
2. The two controls for the First & Last Names are correctly bound to the fields from the QueryDef.
3.The answer is no as no values are returned this time.
4.Before updating the control, all fields on the form are blank.After updating the control I recieve #Name? for ClientFull with FirstName and LastName still empty.

I hope this is comprehensive enough, if not then please let me know.
Last first : Yes this is very clear thank you.
I've read your latest post and, although that might appear to work, it is likely to give you issues when working with live data (You would be accessing the table from two different queries at the same time when using the form).
Your answer to question two intrigues me.
The way I would determine if the fields were bound correctly is by seeing the results. As reported in 3 - the two fields (both of them) appear not to be correctly bound.
Can you post for me the values in :
  1. The Form's Record Source property (If, as I suspect, it is a QueryDef, then please include the SQL used).
  2. The Control source of the TextBox used for the [FirstName].
This sort of problem would be a two-minute issue if the database were available, but things are a lot more clumsy when working via posts in a forum :(.
Feb 15 '07 #36
bloukopkoggelmander
184 New Member
Jip no problems.

I have now set everything back to it was before thechanges I made in post #35.

The details are as follows:

Form Record Source = TestQuery
TextBox Control Source = ClientFull

You are right, the changes I made have been causing me problems. All sorts of strange things were happening in my tables. Well like I said before, it would have been great if we could have posted screenshots of what we are trying to do because it will be soooo much easier for someone like yourself who tries to help others.
Feb 15 '07 #37
NeoPa
32,571 Recognized Expert Moderator MVP
Can you post for me the values in :
  1. The Form's Record Source property (If, as I suspect, it is a QueryDef, then please include the SQL used).
  2. The Control source of the TextBox used for the [FirstName].
I still need :
1. The SQL of [TestQuery].
2. Are you sure you use ClientFull as the Control source for [FirstName]?
Feb 15 '07 #38
bloukopkoggelmander
184 New Member
Sorry about that.

Right as follows :

1. SQL of TestQuery = SELECT Clients.FirstNa me, Clients.LasName , [FirstName] & " " & [LasName] AS ClientFull
FROM Clients;


2. The Control Source for FirstName = FirstName (This is all there is for this textbox)

Fingers crossed. Tell you what, I am dreading this massive project I have to do. It has over 50 tables and many many forms and reports and I have a deadline of only a few months. If I can hardly manage with this one which has only 3 tables and two simple forms!!!
Feb 15 '07 #39
NeoPa
32,571 Recognized Expert Moderator MVP
Can you save the form and attach it to this thread.
I'll check it out.
Feb 15 '07 #40

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

Similar topics

18
12809
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments received. No biggie, right? Well, here's my problem. I don't know how to tell access to modify everyone's account balance each month. And I can't just always assume that their monthly bill is $16 just because their balance is $16. If I do that...
21
2712
by: Dan | last post by:
Hi, just ran into my first instance of a backend Access97 database not compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on compact. I've narrowed it down to the largest table which cotains 600k of records. I've tried copying the database and trying to compact that -doesn't work. I've tried Repair and then compact which also doesn't work. I've tried to create a new database and import the tables but it flakes out...
20
3025
by: Ed | last post by:
I am running Access 2002 and just ran the built in Access wizard for splitting a database into a back end (with tables) and front end (with queries, forms, modules, etc.). After running the wizard, I opened the table relationship view and noticed that all the relationships are missing. Is this supposed to happen? If so, why? I've noticed that queries are behaving strangely now, seemingly because the relationships are not established....
4
18964
by: Neil Ginsberg | last post by:
I have ODBC linked tables to a SQL 7 database in an A2K database. The linked tables do not have the password stored in them, so the first time the user accesses them, they need to enter the SQL password. I am developing a process that will automatically run at night which will access those tables. I need to be able to give Access the password, as the user currently does, so that the process can run without a password prompt appearing....
1
2586
by: Gandalf | last post by:
I'm creating relationships between tables using VBA and ADOX. I can create one-to-one relationships with an inner join, but I can't figure out how to create these relationships with an outer join (specifically a left outer join). I'm including the code that creates the relationships with the inner join. Any help or suggestions would be greatly appreciated. Thanks! <----- CODE FOLLOWS ----->
2
1585
by: Hi5 | last post by:
Hi, I am working on a project in access 2000, Whilst I already have a table called client and seems to be related with other tables ,I tried making TBL client as lookup too, I ended up having another table called Client_1,The question is: 1- How it created? 2- this Why is this table in relationships view and not anywhere else? 3- Is it the same table as client? 4-can I remove One of them?
4
2145
by: Bri | last post by:
Hi, First let me explain the process I have going on, then I'll address the problems I'm having: 1) Insert records in a temp table using a query 2) Using a query that joins the temp table with TableA Insert records into TableB 3) Delete records from temp Table 4) Table specs; temp Table - 4 fields, 3 indexes, gets 100-4500 records inserted
117
18555
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of elements in the HTML to get everything just right. When you consider the class attribute on the DIV elements, there's not much size savings anymore for using DIV. There are other disadvantages to not using TABLE/TR/TD, such as the lack of ability...
5
1897
by: mark_aok | last post by:
Hi all, I have a situation where I have a split database. At the back end, I need to - create a new table (I will call it newTable) with the exact fields, and relationships as another table (let's call it oldTable, and I need to copy everything EXCEPT the data). - Then I need to delete oldTable, and rename newTable 'oldTable'
3
536
by: anjee | last post by:
Hello, Is it possible to create multiple foreign keys on a field in a table from values in two separate tables where the field value can be from one table OR the other? For example, I have an Invoice table where the Customer field is linked (foreign key) to the Customer table. As the application has changed, I now want to introduce the concept of prospects by storing them in a table dedicated to prospects only (no customers). I want...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8243
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.