can not locate record

Posted on 2011-10-28
Medium Priority
Last Modified: 2012-05-12
I've tried several "wizards" to find a record I select so I can modify the information, to NO success. The attached db opens to the form I'm struggling with.
Question by:Frank Freese
  • 4
  • 3
LVL 61

Expert Comment

ID: 37045051
It looks like the name of the event procedure you are using does not match the name of the control.

Do the following:

- Unbind your Store combo by removing its controlsource property (you dont want it editing the underlying field).

- Add the following code to the combos After Update event:

Private Sub cboStore_AfterUpdate()
' Find the record that matches the control.
    Dim rs As dao.Recordset
    Set rs = Me.RecordsetClone
    rs.FindFirst "[BonusEarnedID] = " & Nz(Me.cboStore, 0)
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub

Open in new window

Finally - Set the form's Data Entry property to NO.
LVL 61

Expert Comment

ID: 37045061
A note about the Data Entry property - setting it to 'yes' sets your form up so that the user can only enter new records.  With this setting, finding existing records simply wont work.

Setting it to NO gives the user access to the existing records (which is what you need for this functionality)

Author Comment

by:Frank Freese
ID: 37045222
stupid me....I forgot about the Data Entry property since I stole this form from another. I posted your code - ok...got data when the form opens but the combo box CboStore is empty not showing even the one record I created? Also, the control cboStore is unbounded now
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

LVL 61

Expert Comment

ID: 37045285
What I generally do in my own forms is set up an unbound combo box in the form's header for use in searching for records, and a seperate bound control with the rest of the controls in the detail section if needed for editing.  

In this case, I'd suggest adding a text box for store ID in the detail section of the form.
LVL 61

Accepted Solution

mbizup earned 2000 total points
ID: 37045304
The reason I use seperate controls like that is that I've found that using the same control for editing and searching invariably results in data entry mistakes, problems and confusion for the users.

Author Comment

by:Frank Freese
ID: 37045369

Author Closing Comment

by:Frank Freese
ID: 37045374
thank you

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question