Help with FindRecord
Hello again and thanks in advance..
I've got an orders table with a primary key of OHID (autonum). Ideally the
user could type the order they want to pull up in ctlOHID and have that
record be called up.
Since I'm using an autonumber, I can't have the user enter a value directly
into that field, so I have another unbound text box set up called
ctlOHGoToRec. In the afterupdate section of this I am trying to put this
Dim varOHNewRec as Long
varOHNewRec = Me.ctlOHGoToRec
DoCmd.FindRecord varOHNewRec, , , , , acAll
When this code runs I get the following error:...FindRecord
I'm trying to create a FindRecord macro to find records from/within a
When I select a record from the combo box (search field), I get the
You can't use Find or Replace now.
The fields are controls...
The fields have no data.
There are no fields to search.
What I'm trying to do is create a searchable field in my Form.
E.g., the user selects the records primary key from the combo box, and
the record (in its entirety) appears on the Form (in Form format).
A macro may not be the best way to do this...I'm open to sug...FindRecord in Macro does not return Not Found error
I am designing a database where I can input data in a form and the
macro searches for that data in a particular field and then moves
focus to another field where it inputs pre-defined data.
The only problem is, if the particular search fails, there is no
notification. Instead, it moves on and inputs the pre-defined data in
the last record which had the focus.
I want the macro to return a popup box with the error and close the
What should I do?
On problem with macros (at least the pre-A07 versions) is the lack of error
handling. For that you need a function if returin...docmd.findrecord
I have a form with a textbox that onchange finds the nearest string that is
typed into the textbox in a subform that is a list of customers. If the
docmd.findrecord is keyed to the first column it works great but I now want
it to search a field in the query behind the subform which does not show on
the subform as a text box. For instance if I start to type wei in the
textbox the subform will immediately go to a record that has wei as the first
three letters in the first column of the subform as it should do but on a
different form that searches for full name the letters nes sho...Using DoCmd.FindRecord
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 user clicks the "OK" button and the user
gets taken back to the "Customer" form with the correct searched record.
The function works fine except that every now and then it takes 3-5 seconds
to close the search modal window and goes back to the "Customer" form after
clicking the "OK" button
Below is the actual code for the "OK" button:
- - - - - - -...Access 2000 crashes on DoCmd.FindRecord
Any idea what may be causing this:
An Access database, 2000 file format, designed using 2003 but running on
Access 2000. To open a form and find a specific record, the following code is
DoCmd.GoToControl "QuoteID" ' Contains Record ID
DoCmd.FindRecord Forms!MyQuotes!MyQuotesList_subform!QuoteID <-- CRASH
HAPPENS HERE, DURING SEARCH
Access crashes at the point indicated.
Is there anything about the development having happened in Access 2003
rather than 2000 that may provide a clue as to the cause of this? This crash
occurs on more ...DoCmd.FindRecord Error
My code has a function to find a record. The function is called by 2
separate search forms, each of which generates SQL for a query that builds a
table of record keys of all qualifying recs. When there is only 1 qualifying
rec, the function is called to open the primary form (Member Data) to the
The function uses the rec in the new results table ( a long int ) as the
argument for the FindRecord.
When called by 1 of the forms, it works properly. When called by the second
form it fails on the DoCms.FindRecord line with Runtime error 2162: "A macro
set to 1 of th...FindRecord Control Button
i built a find record control button so a user can type in the form number
and go there but it only searches the field that the cursor is in and the
form # is not on the tab order(purposely). How can i specify where the find
record function searches? thanks
usually people use an unbound combo box or an unbound text box for
There is a sample download with code of a search form at
If you need help to get it working, post back.
You can also use the wizard to put a combo for searching on your form.
On the form in design view, click the...Filter Records after FindRecord
I created a cboQuickSearch combo box, where I can choose the field I would
like to search on. The txtSearchBox text field is where I enter the search
data. I have three issues:
1. I would like to filter the records once found.
2. I want to be able to enter a few characters instead of having to
enter the whole word.
3. Is there shorter code to do the same thing?
Below is the code I created:
Private Sub txtSearchBox_AfterUpdate()
If Me.cboQuickSearch.Value = 1 Then ' Company ID
If Not I...DoCmd.FindRecord...How to use to match a field value
When I open a form, I would like Access to go to a specified record
that meets the criteria in a certain field using the
'DoCmd.FindRecord' command in VBA. Unfortunately I have not had much
success this way. Can you explain how I can find a record based on
the contents of a field on the form. Below is my VBA code.
Private Sub Workouts_Click()
Dim stfilter As String
Dim stFormName As String
Dim getdateid As Integer
stFormName = "Datelog"
getdateid = Me!Workouts.Value
stfilter = "[athleteid]=" & Me![Athleteid]
DoCmd.Close, acform...FindRecord Macro Won't Work
I am trying to run a macro that takes information from 2 separate
fields in one form and then searches a table for the record and then
it populates another form.
The first form only has 2 fields in it. I have one command button
also. For the command button I set the "OnClick" to a macro that
opens up another form and also finds the record that was chosen from
the 1st form.
The FindRecord action is set up like this
Match: Whole Field
Match Case: No
Search as Formatted: No
Only Current Field: Yes
Find First: Yes
The search form has two combo boxes th...