If you have already populated all tables, try this query
Select servicename, toolname from
T_Tool
,T_service
,T_tool_name
Where
T_tool.toolId = T_tool_name.toolId And
T_service.serviceId = t_tool_name.serviceid and
T_service.serviceId = 2
If you have already populated all tables, try this query
Select servicename, toolname from
T_Tool
,T_service
,T_tool_name
Where
T_tool.toolId = T_tool_name.toolId And
T_service.serviceId = t_tool_name.serviceid and
T_service.serviceId = 2
Hello orange again.
I have exactly made a query just like you have posted, but instead of T_service.serviceId = 2 I have T_service.serviceId = serviceid , because I have many services, and i want that the form displayed the tools, for the different servicer. Is that possible ?
Remove this part of your query
T_service.serviceId = serviceid
try this to get all records
Select servicename, toolname from
T_Tool
,T_service
,T_tool_name
Where
T_tool.toolId = T_tool_name.toolId And
T_service.serviceId = t_tool_name.serviceid
thank you again orange ,
The thing is that I want to display in the listbox the toolID and toolname. So, being that way shouldnīt it be "Select toolID, toolname" ?
Yes the Row Source of the listbox should be the query as you suggested.
and yet, the listbox displays always the tools from the serviceid=1 . Even if I am on the record of the serviceid=5 the listbox displays the tools from the service 1.
It sounds like you have actioned a filter, or have not done a requery.
Look for some sample code. I'll be away most of the day.
You'll need something like
"Select servicename, toolname from
T_Tool
,T_service
,T_tool_name
Where
T_tool.toolId = T_tool_name.toolId And
T_service.serviceId = t_tool_name.serviceid and
T_service.serviceId = " & Me.Listbox.value
the last line shouldnīt be ---> T_service.serviceId = " & Me.serviceidtextbox.value ?
where serviceidtextbox is the textbox with the serviceid regarded to the recorded i am seeing
How do you change the Value in the textbox, the serviceID?
Since the value in the listbox -the toolid and toolName related to the service in the textbox - when you change the textbox value (select a different service)
you would have to requery in order to update the data to appear in the listbox.
If you type a value into the text box, then in the afterupdate event of the textbox,
you could do a requery.
The record source for the listbox is something like:
SELECT toolId, ToolName FROM
T_Tool, T_Tool_Name
where
T_Tool.ToolId = T_Tool_Name.ToolId and
T_Tool_Name.ServiceId = Me.textbox.value
David,
I have set up 3 tables and 2 forms hoping to help.
The Form1 shows a combo with various selectable Services.
Once you select a Service, the Listbox shows the related Tools
(Id and name). When you select a new service, you must requery the Listbox,
since it gets is data based on the combo.
see the rowsource of the listbox and
the afterUpdate event for the combobox
Hope this is useful.Private Sub Combo2_AfterUpdate()
Me.List4.Requery
End Sub
Hello orange. Thank you for the tips.
I donīt change the value in the text box. I simply go through the records by clicking the narrow on the bottom of the form. is there any event that is related to the changing of the record the way I discribed?
I have adjusted the database. Look at frmService.
Bound form with a listbox.
I think this is what you are asking about.