Grabbing text data from a form.
Posted on 2005-05-12
I have a form with numerous tabs in it. In one of the tabs I have a text box control, from which I want to grab the text to use in a query. In the query, I want to pull all the data from a table where one feild, "serial number" ( a text feild) matches the data I grabbed from the form control.
My query returns nothing, which should not be the case.
This is the code I've used to grab the data:
frm_Main: Name of the form
TabCtl16: Name of the Tab
Chamber: Name of the text feild
I've tried using text(([Forms]![frm_Main]![TabCtl16]![Chamber])) as well..
but query comes out as a blank even though I've made sure I typed an existing serial number in the form text feild that resides in "serial number" feild in dbo_Incidents table that I'm qurying from.
This is the query that is used:
SELECT dbo_Incident.IncidentID, dbo_Incident.IncidentNo, dbo_Incident.SequenceNo, dbo_Incident.ItemDeleted, dbo_Company.CompanyName, dbo_IncidentCategory.Category, dbo_Product.Product, dbo_IncidentActionTask.ActionTask, dbo_IncidentStatus.Status, dbo_Incident.DueDate, dbo_Incident.Unit, dbo_Incident.LastServiceDate, dbo_Incident.SerialNumber, dbo_Incident.OrderNumber, dbo_Incident.DatePartsReceived, dbo_Incident.ModifiedStartDate, dbo_Incident.ModifiedEndDate, dbo_Incident.FirstSequenceCreatedDate, dbo_Incident.FirstSequenceCreatedID, dbo_Incident.Keyword, dbo_Incident.Problem, dbo_Incident.Solution, dbo_Incident.LockedDate, dbo_Incident.ItemID, dbo_Incident.Priority, dbo_Incident.SalesRepID1, dbo_Incident.ServiceTypeID
FROM (((((dbo_Incident LEFT JOIN dbo_Company ON dbo_Incident.CompanyID = dbo_Company.CompanyID) LEFT JOIN dbo_IncidentCategory ON dbo_Incident.CategoryID = dbo_IncidentCategory.CategoryID) LEFT JOIN dbo_IncidentActionTask ON dbo_Incident.ActionTaskID = dbo_IncidentActionTask.ActionTaskID) LEFT JOIN dbo_Product ON dbo_Incident.ProductID = dbo_Product.ProductID) LEFT JOIN dbo_IncidentStatus ON dbo_Incident.StatusID = dbo_IncidentStatus.StatusID) LEFT JOIN dbo_IncidentUnitType ON dbo_Incident.UnitTypeID = dbo_IncidentUnitType.UnitTypeID
WHERE (((dbo_Incident.ItemDeleted)=0) AND ((dbo_Product.Product)="xrx") AND ((dbo_IncidentStatus.Status)="open") AND ((dbo_Incident.SerialNumber)=([Forms]![frm_Main]![TabCtl16]![Chamber])));
Let me know where I'm screweing up..
Thanks a bunch.