Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Microsoft Access Forms

Posted on 2014-10-29
6
Medium Priority
?
128 Views
Last Modified: 2015-01-08
I need to learn a simple task. I have a form that enables me to enter users into a database. I enter into fields: "username", "Lname", "Fname", etc. I would like to be able to search through previously entered Last names (Lname) to edit users. if I put in record 32 John Doe, and later when I'm on record 100 or so, I want to be able to simply click a dropdown in "Lname" and searvh for Doe and find any and all records with that last name. possibly I might do it with the username instead but you get my drift.
0
Comment
Question by:AlfonsoPina
  • 3
  • 3
6 Comments
 
LVL 85
ID: 40411611
If you want to use a Dropdown, then do this:

1. Add a Combobox to your form. Do NOT set a ControlSource for that combo
2. Set the Combos Rowsource like this: "SELECT DISTINCT LName FROM YourTable"
3. In the AfterUpdate event of your Combo:

Me.Filter = "Lname = '" & Me.YourCombo.Column(0) & "'"
Me.FilterOn = True
0
 

Author Comment

by:AlfonsoPina
ID: 40411848
Ok, this gave me the ability to select a username from the list but it kept the same record I'm working on . for instance:

Username: John.doe
Lname: Doe
Fname: John

after selecting a different username from the list i get the same record but with the new username

UserName: jane.doe
Lname: Doe
Fname: John

so it didn't select the whole record for the username I'm looking for it simply changed the username of the current record. it is close though
0
 
LVL 85
ID: 40412876
I would assume that's not the same record, but rather the record associated with jane.doe (since they have the same LName value, but "Jane" comes before "John").

If you want to find the jane.doe record, you'd have to change the Filter to point to the correct one. I'd assume you'd want to filter for UserName instead of LName.
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

Author Comment

by:AlfonsoPina
ID: 40418798
Yes, sorry, I forgot to respond since I've been traveling.  I changed it to username because of other associations. Those were two different records. If I'm working on record two and for some reason I need to review the first record, I would like to select it from a drop-down.  I dont want to select the name and it simply change the username for the rexord I'm currently editing.  I want it to select and open that record. But that may be asking a bit much now that I think about it.
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 40419195
You generally do searches with an unbound combo, not a bound one, since changing the value of a bound control would update the underlying data.

So if you need a search combo, add a new combo to the form, do NOT set the ControlSource property, and use the code you posted first to locate the record.
0
 

Author Comment

by:AlfonsoPina
ID: 40420741
I'm going to try that right now, let you know shortly how it comes out.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

927 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