I think I did not make myself clear. We organize events and we have a database in which we have, in separate tables, Companies (TBLClienti), Events (TBLFiere) and Orders (TBLOrdini). On the mail Control Panel, there's a button (Gestione Ordini) that, once clicked, opens a form (MSKTBLOrdini) showing the orders for one event. In order to select which event we want to look into, BEFORE that MSKTBLOrdini opens, a pop up message will ask which event we want to choose.
As per the Orders.jpg image this pop up message shows a field in which we have to insert the event code. And, so far, we have to remember the event code.
What we would need is to transform this message box into a combo box (or any other a tool) that will propose the list of events, rather than having to remember the code we want.
To answer Welshgasman, the double ]] was just my mistake in pasting the code in the forum, but in the database the bracket is only one.
I repeat here the SQL we use to open the MsgBox (first) and then, once inputted the event code (SiglaFiera) the form MSKTBLOrdini :
Code:
SELECT TBLOrdini.SiglaFiera, TBLFiere.NomeCompleto, TBLFiere.Edizione, TBLFiere.InizioFiera, TBLFiere.FineFiera, TBLFiere.Cittą, TBLFiere.Padiglione, TBLClienti.CodiceCliente, TBLClienti.NomeAzienda, TBLClienti.Localitą, TBLClienti.Provincia, TBLOrdini.*
FROM TBLFiere INNER JOIN (TBLClienti INNER JOIN TBLOrdini ON TBLClienti.CodiceCliente = TBLOrdini.CodiceCliente) ON TBLFiere.SiglaFiera = TBLOrdini.SiglaFiera
WHERE (((TBLOrdini.SiglaFiera)=[Immettere Fiera]))
ORDER BY TBLClienti.NomeAzienda;
I assume, but I may be wrong, that we have to change something in the part
Code:
WHERE (((TBLOrdini.SiglaFiera)=[Immettere Fiera]))
(Immettere Fiera means Insert Event) in order to have here a combo box or anyway a suggestion, a list of all the events , so to be able to choose it from a list rather than having to remember it.
Thanks again