hi all,
I m using this code for searching with respect to Reg No: -
ADODC1.Recordset.Find "Reg No = " & txtREG
-
But it is not searching
Thanx
25 1864
hi all,
I m using this code for searching with respect to Reg No: -
ADODC1.Recordset.Find "Reg No = " & txtREG
-
But it is not searching
Thanx
Try This One:
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM TableName WHERE FieldName='" & txtREG.Text & "'"
adodc1.refresh
Regards
ervin
Try This One:
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM TableName WHERE FieldName='" & txtREG.Text & "'"
adodc1.refresh
Regards
ervin
Thanxxxxxxxxxxxxxxxx Ervin
And this Thanx for answering my all questions at time.
Try This One:
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM TableName WHERE FieldName='" & txtREG.Text & "'"
adodc1.refresh
Regards
ervin
Hello Ervin,
This code is doing nothing.
I have a database named Information
Table Name is Info
And i have to search about Name and Reg No both.
Please solve the problem
Thanx
Hello Ervin,
This code is doing nothing.
I......Thanx
Try the below code. -
Adodc1.CommandType = adCmdUnknown
-
Adodc1.RecordSource = "SELECT * FROM TableName WHERE strFieldName Like '" & txtREG.Text & "' or numberFieldName = " & val(txtREG.Text)
-
Adodc1.Refresh
-
Adodc1.Recordset.MoveFirst
-
MsgBox " No. Record : " & Adodc1.Recordset.RecordCount
I wouldn't bother with the Val() function, since you're placing it into a string anyway.
That's sample for number field and string field (he is not clear with where clause). Not exactly to the search value..
The sample like below. - Adodc1.RecordSource = "SELECT * FROM TableName WHERE strFieldName Like '" & txtStringValue.Text & "' or numberFieldName = " & val(txtNumericValue.Text)
Thanks all of you for helping me a lot.
Thans again.
Try the below code. -
Adodc1.CommandType = adCmdUnknown
-
Adodc1.RecordSource = "SELECT * FROM TableName WHERE strFieldName Like '" & txtREG.Text & "' or numberFieldName = " & val(txtREG.Text)
-
Adodc1.Refresh
-
Adodc1.Recordset.MoveFirst
-
MsgBox " No. Record : " & Adodc1.Recordset.RecordCount
Hello hari,
This code works but the problem is that after searching the record we can only see the searched record in the grid.
I want to see other records too.
Thanx
Hello hari,
This code works but the problem is that after searching the record we can only see the searched record in the grid.
I want to see other records too.
Thanx
You want to search like
If you type 'A' then the recordset should select name starts with 'A'?
Can you explain properly?
You want to search like
If you type 'A' then the recordset should select name starts with 'A'?
Can you explain properly?
Yeah this one and this too
Suppose i have following records in name field
ABC
ABD
BCD
BBG
XYZ
Now using your code i select ABC to search
Now the DataGrid only shows the record ABC but not ABD,BCD,BBG.XYZ
I want to show all of records.
Thanx
Yeah this one and this too
................
Purpose of where clause is to select particular record then why you want to display all records?
You want to search like
If you type 'A' then the recordset should select name starts with 'A'?
Can you explain properly?
Hello Hari,
One more problem occuring.
When i enter a Field name with a space then it show an error and does not search.
I have search for field Reg No it does not search.
Thanks
Purpose of where clause is to select particular record then why you want to display all records?
I have labels too connected with same database which show only one record at a time.
When i search the required record shows in labels but i dont want to do the same thing to DGrid. i want to show all records here. But the required record will focused automatically when i searched.
Thanx
Hello Hari,
One more problem occuring.
User Trim() function for the text box like...
You have to explain what is that error?
User Trim() function for the text box like...
You have to explain what is that error?
Hello,
I have write this code -
-
Dim es As Integer
-
es = SADD.txtTemp.Text
-
-
ADATA.CommandType = adCmdUnknown
-
ADATA.RecordSource = "SELECT * FROM info WHERE Reg No Like '" & SADD.txtTemp.Text & "' "
-
ADATA.Refresh
-
ADATA.Recordset.MoveFirst
-
-
and the error is in - ADATA.RecordSource = "SELECT * FROM info WHERE Reg No Like '" & SADD.txtTemp.Text & "' "
and error is Syntax error (missing operator) in query expression 'Reg No Like '3"
Thanx
Access versions will not allow space between field names Check that. Reg No should be RegNo
Access versions will not allow space between field names Check that. Reg No should be RegNo
No i have office XP 2004 and i have many fields with spaces like Roll No etc and access doesnot give any error.
Thanks
Spaces within (not "between", Hari) field names are not a problem for Access. But if you're building an SQL string, I believe they can cause confusion. Putting [square brackets] around the field name may help.
As the error message indicated, the SQL interpreter didn't know what to make of "Reg No" - it took "Reg" as the field name, and couldn't work out what sort of operation "No" was supposed to indicate.
Okay I agree...................................!
:) It's just lucky the field name wasn't something like "Reg Like" or we could have some real confusion.
:) It's just lucky the field name wasn't something like "Reg Like" or we could have some real confusion.
That's why i always suggest to use "_" or dont use space betueen field name.
i.e
if i use NameLike it do not show error but it will show error to Name like. and same as
This reserved words - Description
- Password
- Name
- Day
- Month
- Year…etc.
Hello,
Killer i have tried this too i put two braces around it but nothing done error still occur but now i have changed the field names to RegNo and RollNo.
But now another error occurs but it is not syntax i think its logical.
On some forms the code searches right but on some it does not.
Hari please help how can i debug this.
Thanx
Killer i have tried this too i put two braces around it but nothing done error still occur but now i have changed the field names to RegNo and RollNo.
If removing the spaces made a difference, then the square brackets should have worked. It might vary depending on what database we're talking about. But you indicated this was Access. Generally, the simplest way to get a query right for Access is to create it in the Query Designer in Access, then copy the SQL that it generates. As long as you don't mind it inserting dozens of extra parentheses, that is.
But now another error occurs but it is not syntax i think its logical.
On some forms the code searches right but on some it does not.
Hari please help how can i debug this.
Well, what is different between the forms? And can you show us the new code? And please provide full details about the new error.
Well, what is different between the forms? And can you show us the new code? And please provide full details about the new error.
Thanx killer i have found the error.
I have made som echanges to code but on some codes i forgot to made changes.
Bu now its working.
Yhanx a lot
Ok. Glad to see you managed to resolve your problem.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Sean Dodsworth |
last post by:
Can anyone tell me how to get a message's number from the message-id
using IMAP4.search?
I've tried this:
resp, items = server.search(None, 'HEADER', '"Message-id"', msgID)
but it gives me a...
|
by: Stanley Sinclair |
last post by:
Bear with me. I am being very calm; took a Valium. I have waited two
weeks to write this, because every time I wrote it before the message
was, at best, nasty.
I need to use the services of...
|
by: Dica |
last post by:
i apologize for what is no doubt a very rudimentary question, but i'm still
trying to wrap my brain around .net coding habits. in classic asp, if i
wanted to show search results, i'd just post the...
|
by: San |
last post by:
Hey,
I need to create a form with several text boxes in which users type in
key words, press a command button on the form and it opens a matching
record. Thanking you in advance.
|
by: Luis Corrales |
last post by:
Hi all,
I have a problem when searching for text with special characters in
e-mails in an IMAP server. I'm using imaplib in python 2.4.3 and I can't
get this code working:
# first connect and...
|
by: Sheau Wei |
last post by:
This is the search engine code that i create, but it was error and didnt come out the result. Cn u help me to check what wrong with my code?
Thanks
<Table cellspacing=1 cellPadding=1...
|
by: BenCoo |
last post by:
Hello,
In a Binary Search Tree I get the error : Object must be of type String
if I run the form only with the "Dim bstLidnummer As New BinarySearchTree"
it works fine.
Thanks for any...
|
by: ljungers |
last post by:
I'm on the home streach of my project and found that my "Reset for New Search" command button not working as desired. What should happen is that when the button is clicked a Event Procedure is run....
|
by: captainmorgan |
last post by:
I have included an unbound field called which is used to quickly move to the desired record, by searching the last name field.
I have been using this code for a few years, with only one...
|
by: jej1216 |
last post by:
I am trying to put together a PHP search page in which the user can select none, one, two, or three fields to search, and then the results php will build the SQL with dynamic where caluses to reflect...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
| |