Solved

Microsoft Access Forms

Posted on 2014-10-29
6
122 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 84
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 84
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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

830 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