The lookup field in question is the last one from the SELECT statement (Dossier.Id_Service). This field is the one that works correctly at the table level however on the form I can see the data but can't select it.
As per my previous post I have other lookup fields on that form such as (Dossier.ID_intervenant) which is part of the same table as my problematic combo box. The only difference between the two is that Dossier.ID_intervenant parent table (INTERVENANT) as a 1 to many relationship established with the DOSSIER table. The Dossier.Id_service field uses a query on the SERVICE table which does not have a relationship with the DOSSIER table.
allright. I found it. in your query you should change field;
Client.Code_SFP to Dossier.Code_SFP
add Dossier.Id_Référent field into query. dossier table was showing up Read-only because you didn't include foreign keys in your query and query didn't know how to fill them up.
I was away for a while...now I am back to the grind!
OK I have read your last post. It gave me an idea...the form that I was working with did not contain any subforms it was all based on the Dossier_ID.
So I went and tested different forms/subforms for the client information. All I am trying to do with these forms is input all of the client information in the client form and all pertinent information for is consultation.
So after creating a form called "Références2" and a sub form "Références_details" I still get the same problem with the service field. At the table level (Dossier) it works fine but at the form it does not.
I am attaching printscreen of the DB structure, let me know what you think.
I have made some modifications to the service field they are now called Code_service instead of ID_service.
Let me start by saying Welcome to the Forum as I see you haven't been here too long. Good to have you.
Now, for your DB problem I d/l it and tried to figure out just what was going on all in it but couldn't. However, I think you had a problem with the ComboBox in the References form? The one labeled Code de Service
If so then I fixed that part of the program for you as it now pulls in the data. At first, as you stated it would drop-down and show you the choices, but not let you select any. As for how all your other forms are to work I wasn't sure because I didn't know what one thing had to do with the other. Not really sure but some of the TableRelationships might be not so right, but that's a guess. If I had more time I would try to work everything out for you but time is not such a luxury for me. But will try to work on it off and on and check to see occassionally if you have it all working. Anyway, just wanted to try to lend a hand.
have a nice one,
Silly me, I forgot to attach it back here for you.....geez..must be late. Well here goes......WELL, guess I will try later today after about 5 mins. it still didn't upload. Keep looking......
My problem with the CODE_SERVICE field is resolved and I still don't know what was the problem?? I have not changed anything to the queries that I was using for that field, it just started behaving like it was supposed to.
I have another field (ID_INTERVENANT) in the same table (RÉFÉRENCES_DÉTAILS) that does the same weird action at the form level. I see the choices from the combo box but can't select them just like if the field was locked but it's not. The source for that combobox is a query that is built like so:
SELECT Intervenant.Id_intervenant, Intervenant.Prénom & " " & Intervenant.Nom & ", " & Intervenant.Fonction AS Intervenant
The CODE_SERVICE field uses a similar query:
SELECT Service.Code_service, Service.Description
The only difference is that the first query concatenates three fields into one for the field INTERVENANT.
This is nuts...both field at the table level are built in the same fashion and they both work correctly but at the form level the ID_Intervenant combobox does not work!
as I said before your problem is not the the query in the combobox' control source. it is about the query of your form. The Query of your form returns readonly results for some specific fields. which stops combobox to change that field. please check your form's query.
I am going to try that this evening. I'll remove all lookup query from the table level and define all fields to characters and then use the lookup on the form only. Not both table and form. I think that is why my lookups fields were acting strangely.