hello,
I have a code like: -
Private sub button1_Click()
-
DoCmd.FindRecord Me.fieldname.Value, acStart, , acSearchAll, , , False
-
end sub
-
but the problem is that the command stops searching at the last record. so the records before the current record are not searched. I thought with acSearchAll it should search the entire record list.
I need some help here.
8 5456
I don't know what object you are using, but DataReader can only be searched through once.
I am working with Ms access forms and the code above is a control for a button. I don't want to start searching from the first record (this works fine). the docs show that the above code should search from the current record to the end of the set, then start from the beginning to the current record. in the end all records should be searched. I don't know why this doesn't work for me.
I may have posted this question in the wrong place
So this is VBA? I will move it then.
NeoPa 32,556
Expert Mod 16PB
Thanks Plater :)
Try : - Call DoCmd.FindRecord(FindWhat:=Me.FieldName, _
-
Match:=acEntire, _
-
Search:=acSearchAll, _
-
OnlyCurrentField:=acCurrent, _
-
FindFirst:=True)
Please let us know if this works for you.
yes it is vba, thanks for moving it; i tried to figure out how to do it.
thanks NeoPa for the code. it begins always from the first record. also it would always find the first hit. My code begins from the next record after the current record and should cycle through the entire record set back to the current record just like the Access 'Find Next'.
I'm still trying to find out why it ends at the last record instead of continuing from the first record back to the current record.
NeoPa 32,556
Expert Mod 16PB
I looked in Help & it says little more than listing the available values for the parameters. Essentially, it's not a lot of ...
Anyway. I suggest your next step is to experiment with the three parameters (Match, Search & FindFirst) to see if you can come up with a combination that does it as you need. Unfortunately, it is sometimes necessary to do some research (in this case trial & error) before being able to understand things correctly.
I couldn't get the docmd.findrecord to work like I wanted so I implemented my own search over the recordset.
Thanks for your suggestions.
NeoPa 32,556
Expert Mod 16PB
That seems like a shame. Sorry I couldn't be more help.
A self-made search should only be noticeably slower if the number of records is quite large though.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: STeve Lefevre |
last post by:
Hey folks --
I'm using the DoCmd.GoToRecord , , acNext to jump to the next record
after the user enters a value. The problem is, it throws an error if
it's already on the last record! What's the...
|
by: chanchito_cojones |
last post by:
hi there,
I am needing some help with a database I am putting together. The database
works off of a main Form, which then has buttons on it that will open up
other forms. The problem I am having...
|
by: Doug W. |
last post by:
I want to merge just one record from a query in my Access database into
a Word document. This allows me to send one letter to one client by
first extracting the client's address data, personal...
|
by: Stack |
last post by:
Hello,
I have my data sorted on date desc in my form (multiple recs/table
style). When I want to insert a new record (with my self made button
and vba code(DoCmd.GoToRecord , , acNewRec)) the...
|
by: Ryan |
last post by:
Hello. I was hoping that someone may be able to assist with an issue
that I am experiencing. I have created an Access DB which imports an
Excel File with a particular layout and field naming. ...
|
by: BUmed |
last post by:
Well, in need to find a record using a command button so I set up a FindRecord in a macro. Now the person wants to be able to find all the records that meet the last name criterian so I thought I...
|
by: RAG2007 |
last post by:
Hi
Having some problems with docmd.findrecord, getting runtime error 2162, in an adp, sql server back end.
On my main form, I have a continuous view subform giving a list of subrecords within...
|
by: Ben Lahoy |
last post by:
Hi!
My problem is basically in a search modal window, where the user is allowed
to make a selection on which option to take. After selecting an option and
then giving the data to search, the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: 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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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,...
| |