Topics Search

Search Records VBA?

Search Records VBA?
Views: 87
I have a dbase I am working on that I want to be able to search all records and pull of those with matching fields.
I.E. a name, or catageory or number.

Orignally I used a microsoft template and changed what I needed but I decided to do it from the ground up to make it cleaner. Now that I have got to the search forms/tables I can not get it to work.

The question is can I do a search from a form, without using VB since I know not a thing about it.
Sponsored Links:

More topics

 

Mailing Labels from a Search Form

Preview
I have a Search form (frmSearch) based on the method of Allen Browne (http://allenbrowne.com/ser-62.html) which I highly recommend as it creates queries on the fly. It is based on a query (qrySearch). I can easily export the results to Excel with a short VBA code I found (Send to Excel). What I need is to create labels from these results. I have created a report to generate labels using the Access 2007 Label wizard. This report is also based on the same query as the Search Form.

I thought that if I obtain my search results I could simply send these to the label Report using a macro ("Open Report"). Unfortunately all I get is ALL RECORDS RETURNED, not the search form subset of records in front of me.

I am unable to base the labels Report on the Search Form. Any ideas? Can this be done with a Macro or is it strictly VBA? If VBA, is there an example I can follow
 

VBA table population

Preview
This is my first post and I am relatively new to VBA but not to programming in general.I have a small table that I successfully created a small search function for and now I am trying to find a way to add records to the table.

As of right now I have a main form with 2 buttons, one for the search and one for the add. The form for the add is finished except for the VBA in the back end. The fields in the add form correspond to the fields in the table but I can't figure out how to go about getting new records into the table.

Is it an SQL INSERT statement? Or is there a built in function in VBA thatwill allow me to do this?
 

Mailing Labels from a Search Form

Preview
I have a Search form (frmSearch) based on the method of Allen Browne ([LINK]) which I highly recommend as it creates queries on the fly. It is based on a query (qrySearch). I can easily export the results to Excel with a short VBA code I found (Send to Excel).

What I need is to create labels from these results. I have created a report to generate labels using the Access 2007 Label wizard. This report is also based on the same query as the Search Form.

I thought that if I obtain my search results I could simply send these to the label Report using a macro ("Open Report"). Unfortunately all I get is ALL RECORDS RETURNED, not the searchform subset of records in front of me.

I am unable to base the labels Report on the Search Form. Can this be done with a Macro or is it strictly VBA? If VBA, is there an example I can follow?
 

Search on Subform

Preview
I have a subform on a form. I know that there is a certain word in a field on the subform, but when I try to use the in-built search feature to search for it, I get an error.

It seems that the search on the subform only searches in the child records related to the current parent record.

Does anyone know how I can seearch in ALL records of ALL the parent records (if that makes sense
 

Using IIF & Like statements in query

Preview
Normally I would do this in VBA, but I'm intrigued as to whether I can do it in a query.

I'm building an advanced search for my DB and the user can select many option:

1) What field to search in
2) Whether to search the entire field, or Any part of the field
3) Whether to search all records, or just 'Live' Records.

To do this I'm trying to use the iif statement. But can't get the LIKE operator to work inside the iif.

eg:

IIf([srchCriteria1]=1,Like '*' & [name] & '*',[name])

This works fine if srchCriteria1 isn't '1' and the full name is found. But can't get it to search any part of field
 

Access Search box via VBA

Preview
I successfully created a form and a search box within Access using a VBA code. I am tasked with performing another search but now each unique identifier has multiple data associated with them that I need identified in my search form. Does anyone know how I can update the code to show these changes
 

search records and export

Preview
I have a project need to create a user interfact. The function of the interface, 1). allow end user enter a search range (date informat), 2). create a button which will do search and export the search result into a excel / CSV format file into a folder, 3). the exported file's name will be automatic set as exported date.
Do you think this one can be done without VBA? if yes, how to do that?
 

Search a Subform

Preview
I want to search a subform, of course the search only looks at the current form not all the records ever entered .
So I have in the subform a search btn
...
Closes the form (and Sub) and opens the sub on its own with all the records search works, I then have an exit btn under the search btn which is now visible False...
 

Text Box search of Form with a Combo as Part of Form search

Preview
I have started creating a database with a bound form. What I want to know is how to use either one of the records for a search for the related records associated with it or a separate text box to initiate the search. at the same time I want to replace say two of the fields text boxes with a combo box that will retrieve any and all records for the associated fields related to the search field, which will be two columns of data drop data.
 

Make a search function on a button that searches through records?

Preview
I tried creating a search button using the wizard for a customer database I created, however, the search function for the customers – sometimes it doesn’t work. Also I need to be able to search all the fields.

So if I search “Berlin” and there are multiple records with “Berlin” – I would like to display possible results containg the word "Berlin". Can this be done? If so, how can this be developed?