UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Search Box In Asset Tracking Template Problem, Access 2013    
 
   
cjmcneil
post Jul 16 2017, 05:40 AM
Post#1



Posts: 2
Joined: 16-July 17



Hi all and many thanks in advance for your help smile.gif

I'm quite a new user with a lot to learn with access and I've been trying to modify the asset tracking template for my workplace. I'm using it as a simple vehicle register which can be used to quickly find information such as vehicle names, registration numbers, radio ID numbers etc. nothing too complicated for my first database.

Instead of renaming pre-existing template fields I've added in some new field names to record this new data which isn't on the template. When I'm in the Asset List form there is a search box included in the template - however when I go to use the search function it fails to display any records from my new fields. I can see the fields and data in the columns but the search doesn't seem to register this data. It only successfully populates searches from fields originally in the template.

Any tips would be greatly appreciated as I'm not sure if it's a formatting or relationship issue that I've missed.

Kind Regards,

Chris
Go to the top of the page
 
ScottGem
post Jul 16 2017, 08:09 AM
Post#2


UtterAccess VIP / UA Clown
Posts: 32,164
Joined: 21-January 04
From: LI, NY


Welcome to UtterAccess

QUOTE
however when I go to use the search function it fails to display any records from my new fields. I can see the fields and data in the columns but the search doesn't seem to register this data. It only successfully populates searches from fields originally in the template


I think you are saying that incorrectly. I think what you mean is that when you use the Search it retrieves the record, but the controls that should show data from the fields you added don't populate. If that's what you meant, then the probable answer is you didn't set the Controlsource of the new controls properly.

You don't have "fields" on a form. You have "controls" that may or may not be bound to a field in a table. This is a subtle but important distinction.

So if you added controls without setting the Controlsource to a field in the table, then the control will not reflect the data in the record.

--------------------
Scott <>
Scottgem's Blog
Microsoft Access MVP since 2007
Author: Microsoft Office Access 2007 VBA
Go to the top of the page
 
cjmcneil
post Jul 17 2017, 04:50 AM
Post#3



Posts: 2
Joined: 16-July 17



Apologies for the wrong terminology, I can see how the Controlsource is the root of the problem. Is there a simple way of ensuring that the search box is programmed to include the additional fields I have added in my assets table? I can't quite work out how I adjust the Controlsource to reflect this.

Or is the solution to create a calculated text field in my table and go down the expression builder /new macro route to ensure all my fields are included in any search box used in my forms?

Thanks
Go to the top of the page
 
ScottGem
post Jul 18 2017, 07:00 AM
Post#4


UtterAccess VIP / UA Clown
Posts: 32,164
Joined: 21-January 04
From: LI, NY


The Search box probably has nothing to do with the the additional controls. The search box (most likely, but not sure since you don't show us the code) simply retrieves the record based on its primary key. So the solution is to properly set the Controlsources. this is extremely easy. In the Properties dialog under the Data tab, pull down the list and select the field.

However, if the field is not on the pull down list, it means its not in the Form's Recordsource. Based on what you said, I'm assuming the form is based on a single table. So if its not there, it means you are using a SQL statement for the Recordsource which needs to be updated.

--------------------
Scott <>
Scottgem's Blog
Microsoft Access MVP since 2007
Author: Microsoft Office Access 2007 VBA
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    21st October 2017 - 09:47 PM