• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Grabbing text data from a form.

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:

([Forms]![frm_Main]![TabCtl16]![Chamber])

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.
Nihal


0
javalite
Asked:
javalite
  • 2
1 Solution
 
manthaneinCommented:
I'm going to suggest  a lazy person way to solve this.. and I hope it works..    have you tried  ([Forms]![frm_Main]![Chamber])  
0
 
javaliteAuthor Commented:
you're the champ.. I read some where that if you use a tab, u have to include the tab name as well.. but what u know.. ur solution works..
thanks mate..!
0
 
manthaneinCommented:
welcome...   thanks   for the points...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now