473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Search form

Dears Experts
I have a small database with one table; the fields are Id, Obra, Material, SNumber, Cliente and several others.
I want a form to search and filter for Cliente = Client; and show all records in a list for this client. Of course my database has several clients.
Any detailed help will be useful for me.
I am beginning to learn Access but I have certain knowledge in programming, in particular, Clipper, Visual Basic.

Buineugenio
Mozambique, Africa
Apr 17 '08 #1
12 1590
kcdoell
230 100+
Dears Experts
I have a small database with one table; the fields are Id, Obra, Material, SNumber, Cliente and several others.
I want a form to search and filter for Cliente = Client; and show all records in a list for this client. Of course my database has several clients.
Any detailed help will be useful for me.
I am beginning to learn Access but I have certain knowledge in programming, in particular, Clipper, Visual Basic.

Buineugenio
Mozambique, Africa

Hello:

-First create a query by using the "Simple Query Wizard". Choose the table and the fields you want in your form and click finish

-Then in the design mode of that query, look for the field that has the word "Client" and in the criteria section of that column key in:
="client"

-Then use the "Form Wizard" and choose the query as the record source."choose the table or query where the object......" and follow instructions or if you already created the form, go into the properties of the form and point the record source to the query.....

Hope that sheds light on the subject...

Good Luck!

Keith.
Apr 17 '08 #2
Hello:

-First create a query by using the "Simple Query Wizard". Choose the table and the fields you want in your form and click finish

-Then in the design mode of that query, look for the field that has the word "Client" and in the criteria section of that column key in:
="client"

-Then use the "Form Wizard" and choose the query as the record source."choose the table or query where the object......" and follow instructions or if you already created the form, go into the properties of the form and point the record source to the query.....

Hope that sheds light on the subject...

Good Luck!

Keith.
Keith
I follow the steps in your answer and every thing work fine!
Now, I have a next step in this same question.
How to add a text box and a command button in the form to find any Client's name entered in the text box?
I think that is possible to do that.
Thanks again, your help was very useful, I get the answer that I wanted, show all records for a Client in a datagrid!

Buineugenio

Maputo, Mozambique, Africa
Apr 22 '08 #3
kcdoell
230 100+
Keith
How to add a text box and a command button in the form to find any Client's name entered in the text box?
I think that is possible to do that.........
Buineugenio

Maputo, Mozambique, Africa
Of course it is. Where I told you:....the design mode of that query, look for the field that has the word "Client" and in the criteria section of that column key in.....

Replace:

="client"

with:

[forms].[NameofYourForm].[NameofYourTexbox]

Your will have to switch the verbiage to match your form name and textbox name...

Then in the properties of the comand button go to the OnClick event. Choose code builder and input the following:
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCommandButtonName_Click()
  2. 'Requery your form
  3.     DoCmd.Requery
  4. End Sub 
All the you will have to do is key in the "DoCmd.Requery" the rest will be there. That should do it. Keep in mind that It will only find exact matches that you input into your text box.
Apr 22 '08 #4
Of course it is. Where I told you:....the design mode of that query, look for the field that has the word "Client" and in the criteria section of that column key in.....

Replace:

="client"

with:

[forms].[NameofYourForm].[NameofYourTexbox]

Your will have to switch the verbiage to match your form name and textbox name...

Then in the properties of the comand button go to the OnClick event. Choose code builder and input the following:
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourCommandButtonName_Click()
  2. 'Requery your form
  3.     DoCmd.Requery
  4. End Sub 
All the you will have to do is key in the "DoCmd.Requery" the rest will be there. That should do it. Keep in mind that It will only find exact matches that you input into your text box.
Keith
I follow your instruction, step by step but when I open the form, only appaer the datagrid with the name of the fields, empty.
Maybe in your instruction something is missing?

Buineugenio
Mozambique, Africa
Apr 24 '08 #5
kcdoell
230 100+
What happens when you key something into your text box and then hit your command button??

Remember, that your query is now looking for an input in that dialogue box to run the records that it will display so naturally it will be blank when you first open it.
Apr 24 '08 #6
What happens when you key something into your text box and then hit your command button??

Remember, that your query is now looking for an input in that dialogue box to run the records that it will display so naturally it will be blank when you first open it.
Keith
The Query opens immediately, I have no chance to write in the text box!
But when I open the Query directly, not using the form, appear a small windows asking for the parameter to search, in this case, the Client's name, when I enter the name, the query works fine. Show all the records in the datagrid with that Client.
They work separately, seems that a link is missing between the form and the query.
Thanks for your help again!
Buineugenio
Apr 25 '08 #7
kcdoell
230 100+
Keith
The Query opens immediately,................Thanks for your help again!
Buineugenio
Buineugenio:

I need more help on what you are doing.

In your query, give me the name of the field, that you are using for your criteria and the actual criteria expression.

Give me the Form name (Found in the properties section "name")
The Name of the text box on that form (Found in the properties section "name")

It is probably something simple, but without having it in front of me it can be challenging to know what is going on...

Since it did work for the "="Client"" criteria, the problem is most likely rooted in the new criteria expression..

Thanks,

Keith.
Apr 25 '08 #8
Buineugenio:

I need more help on what you are doing.

In your query, give me the name of the field, that you are using for your criteria and the actual criteria expression.

Give me the Form name (Found in the properties section "name")
The Name of the text box on that form (Found in the properties section "name")

It is probably something simple, but without having it in front of me it can be challenging to know what is going on...

Since it did work for the "="Client"" criteria, the problem is most likely rooted in the new criteria expression..

Thanks,

Keith.
Keith

Here is the criteria:
[forms].[Cliente].[Text10]

Text10 is the name of the Text box
Cliente is the form's name

Thanks again
Buineugenio
Apr 28 '08 #9
kcdoell
230 100+
Open the form, leave it open and then input something that you know it should find in Text10. Then go to your query and run it. What happens with your query? Did it find any records? Do you still get a pop up box when the query runs? We are trying to determine first if your query can find Text10 or not...


Also, sometimes swapping the . with ! works also but first see what is going on exactly with the way it works now.

[forms]![Cliente]![Text10]
Apr 28 '08 #10
Open the form, leave it open and then input something that you know it should find in Text10. Then go to your query and run it. What happens with your query? Did it find any records? Do you still get a pop up box when the query runs? We are trying to determine first if your query can find Text10 or not...


Also, sometimes swapping the . with ! works also but first see what is going on exactly with the way it works now.

[forms]![Cliente]![Text10]
Keith
I delete [forms] from the criteria and works fine. First appear a small popup window asking for the parameter to search, I entered 2 non equal Cliente name and show a datagrid with all of them in the Query. This is more or less what I wanted.
By the moment I am glad with the results. Thanks for your help
Buineugenio
Maputo, Mozambique, Africa
Apr 29 '08 #11
Keith
I delete [forms] from the criteria and works fine. First appear a small popup window asking for the parameter to search, I entered 2 non equal Cliente name and show a datagrid with all of them in the Query. This is more or less what I wanted.
By the moment I am glad with the results. Thanks for your help
Buineugenio
Maputo, Mozambique, Africa
Keith
Now I am trying to find and fix, why the form do not open? I how in the actual situation can I use again, without closing, a new search, I want to reset the search and write a new client's name without closing the form, that actually do not open.
Thanks
Buineugenio
Maputo, Mozambique, Africa
Apr 30 '08 #12
Keith
I add the next code:

Dim strStudentRef As String
Dim strSearch As String

'Check txtSearch for Null value or Nill Entry first.

If IsNull(Me![Text10]) Or (Me![Text10]) = "" Then
MsgBox "Please enter a value!", vbOKOnly, "Invalid Search Criterion!"
Me![Text10].SetFocus
Exit Sub
End If
and now the message box appear asking for the parameter. Is working but I am trying to fix this because if I leave empty the Text10 box, the query opens and do not appear a message box asking for the value.
I will try a loop to eliminate this bug.

Regards
Buineugenio
Maputo, Mozambique , Africa
May 6 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
1
by: bdawg | last post by:
what i want to do is create several radio buttons and a textbox for searching purposes. the search will perform a search depending on which button the user selects. here is what i have now: ...
1
by: N. Graves | last post by:
Hi, I want to have a Search Dialog box that has several text box and fields to build a search and display the results in a form. I can do everything that I need to if I us a report but I would...
9
by: Christopher Koh | last post by:
I will make a form which will search the database (just like google interface) that will look/match for the exact name in the records of a given fieldname. Any suggestions on how to make the code?
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
1
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and...
5
by: Fran Jakers | last post by:
Hello all, I'm new to all this and I could really use some help. I've searched the web but cannot find an answer. I have an HTML form with 3 radio buttons and a search field that calls a...
2
by: Mark | last post by:
Hi All, I am creating a music database for a friend and have run into a problem. Within the ALBUM table, I wanted to store the ARTIST_ID rather than the ARTIST_NAME. To do this, I intended to have...
12
by: iahamed | last post by:
Hi Everyone, I got two parts of my advance search to work, I am running out of Logic to connect the third. My mind is in swing! Pleaseeeeeeeee Help me. I have 3 Fiels to search, the First two...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.