Assistance with Access search field - ms-access

I have a search field that works on my other forms and I am trying to use it for this purpose.
I track reported numbers for my providers in hours.
I have several provider and will be giving this database to other sections so I cannot make is specific to my providers.
My SearchResults field selects the record when clicked on.
Here are my two problems:
I need the SearchResults field to display "Provider", "Data_Month", and "Data_year". I can't figure that out.
When the name is the same, it sets the month to the same month for each entry.
This is the row source for the SearchResults field:
SELECT [Provider_Time_Query].[Provider] FROM Provider_Time_Query WHERE ((([Provider_Time_Query].[Provider]) Like "*" & Forms![Provider Time]!SrchText & "*")) ORDER BY [Provider_Time_Query].[Provider];
Any help would be greatly appreciated. If I'm going in the wrong direction, please help me find my way! Thank you!!!

Related

Access parameter query not returning records with specific value

Yesterday I asked a similar question, and thank you to those who replied. I'm creating this new question as I've worked a few things out and can hopefully provide more/better information, but still running into the same problem. I'm very, very new to Access and any kind of code or related terms so thank you in advance for your patience with me.
I'm building a query to search tbl: Inventory. There are no lookups built into the table. The parameters can be entered via combo boxes on a form by the user. The row sources for the combo boxes are distinct values from the coordinating fields in tbl: Inventory. I want the user to be able to fill in any/all parameters and get results, so I'm using LIKE "*" in my criteria of each parameter. All values in the parameters are text. In tbl: Inventory the fields are also all text (except the PK which is an autonumber). This is my SQL for the query:
SELECT Inventory.InventoryID, Inventory.SetID, Inventory.ItemName, Inventory.Period, Inventory.Color, Inventory.GarmentType, Inventory.GarmentSubType, Inventory.ATCShow
FROM Inventory
WHERE (((Inventory.Period) Like "*" & [Forms]![frmSearchInventory]![cboPeriod] & "*") AND ((Inventory.Color) Like "*" & [Forms]![frmSearchInventory]![cboColor] & "*") AND ((Inventory.GarmentType) Like "*" & [Forms]![frmSearchInventory]![cboType] & "*") AND ((Inventory.GarmentSubType) Like "*" & [Forms]![frmSearchInventory]![cboSubType] & "*") AND ((Inventory.ATCShow) Like "*" & [Forms]![frmSearchInventory]![cboShow] & "*"));
Please excuse the excess brackets, as I said, very new so I'm letting Access do most of the writing for me.
For some reason, no matter what combination of parameters are used, it will not return any records where Inventory.GarmentType = suit coat, and the record also includes a SetID--even if the only parameter entered is "suit coat". For records that do not include a setID and are type=suit coat, the record is returned. If the record includes a setID and is not a suit coat, the record is returned. Not sure if that is related, as SetID is not a parameter, but it's something I noticed.
I've tried changing "*" to "%" and LIKE to ALIKE and no records at all were returned.
Any ideas? Happy to provide any additional information. Thank you!

How do I split a full name field (Report Builder)

I have a name field that displays as "Mr A Test" for every record (eg. Title initial Surname)
I need to split the full name into 3 Individual fields, Title, Initial and surname.
Is anyone able to offer any assistance? I'm fairly new to Report Builder so I have already exhausted my skill base and my searches here have so far been unsuccessful.
Thanks in advance
Can you not arrange your query to provide individual fields? This would be best.
If not, one way might be to use the split function in the expression builder eg
=Split(Fields!Fullname.Value, " ")
This results in an array of strings separated by the space. You can then access each element thus
=Split(Fields!Fullname.Value, " ").GetValue(x)
where x is a zero based index

Access 2007 - Using results of an equation inside another equation on a report

I inserted three text boxes to test how this could work:
Text81: =1
Text82: =2
Text83: I want this one to be the sum of Text81 and Text82
Thanks in advance for your help on what I think is a pretty simple problem.
There are a couple options that spring to mind.
First you could always modify the data source for the report to include the calculated field.
Second, which is what your question drives at, you can do something like this:
=[Text81] + [Text82]
Should work when typed into the Control Source of a TextBox provided Text81 and Text82 are the data field names from the Data Source of the Report. If they are not you would put the corresponding data field names in the square brackets []
Hope this helps

Returning specific field from a matching record

I'm still a newbie at Access 2007, but I feel I am missing a understanding of a concept, when it comes to using user input from an unbound text box.
I'm trying to have the user input the record number (i.e. A12) and return another field in the matching record (such as the record status like "Opened")
I'm fiddling with DLookup to see if it will work through that method but no luck yet.
I may look into SELECT - SQL, but I haven't used that function yet and not sure if that will give me the result I'm looking for.
If this is something elementary to access programming (or databases in general), please let me know where I can read up on this.
I am currently using the MSDN website, but examples go much further to play with.
Edit:
My DLookup so far, which happens after update from user on Text12
Me.Text14.Value = DLookup("[RecordStatus]", "Orders", Text12.Value)
Thanks
Look closer at the third option (Criteria) in your DLookup() expression. You gave it only Text12.Value, which I assume is a string value like "A12".
The Criteria parameter should be like a WHERE clause in a query, without the word WHERE. IOW, some field's value = "A12". If that field is named "record_id", try this:
DLookup("RecordStatus", "Orders", "record_id = '" & Me.Text12 & "'")

Combining fields and replacing text in Crystal Reports

I am a new Crystal Reports user and any help would be greatly appreciated. I am looking for a formula that allows me to combine two fields and also make a text replacement (mapping project).
For example, I am looking to combine an address and city into one field so I use the formula:
{Location.Address}+","+" "+{Location.City}.
This is usually sufficient except for a common street in town which is abbreviated in the records system. I need for the entries which read "24 SGE, Albany" to read "24 Stargate East, Albany" so the address can be interpreted by the mapping software.
I tried something like
{Location.Address}+","+" "+{Location.City}
and
Replace({Location.Address}," SGE"," Stargate East")
I got the error, a boolean is require here. So I am probably still far off. Any suggestions?
Replace({Location.Address},"SGE","Stargate East") + ", " + {Location.City}