Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Access

Posted on 2016-08-16
5
Medium Priority
?
80 Views
Last Modified: 2016-09-02
Hi all,

I have a MS Access database (see attached).

The frmClassEntry from is where I enter members who attend a workout class.  When I enter the Member ID and hit enter the data below populates with the member’s name.  If I don’t know the member’s ID number then I click on the Search Member button and the form frmSearchMember opens.  Then I lookup the members name to find the Member ID number and then I switch back to the frmClassEntry to enter the Member ID.

How do I use the frmSearchMember to search for the member by using one any of the text boxes and clicking on the record and then it gets entered in to the frmClassEntry from.
DataEntry.accdb
0
Comment
Question by:Reyesrj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41761214
You can use a global variable, that is set to zero when you open frmSearchMember , and set to a valid ID when you close frmSearchMember.
When frmClassEntry gets the focus, if the Member ID is empty and the global is valid, then assign the global to the Member ID field.

there are probably many other (some more elegant) ways, but this is how I do it.
0
 

Author Comment

by:Reyesrj
ID: 41761678
Thank you Coachman99,

I'm new at this and I've been getting tips and bits of help from people and internet searching.  Yes, I agree, there are better ways of doing this.  I welcome and appreciate any and all suggestions.  If possible could you upload samples and instructions.
0
 
LVL 7

Accepted Solution

by:
COACHMAN99 earned 2000 total points
ID: 41761792
I am not able to provide a VBA tutorial but:
1. create a global variable
2. set it to zero in the form load event when you open frmSearchMember
3  set it to a valid ID (if the id is a valid one, else 0, when you close frmSearchMember (form unload event)
4. When frmClassEntry gets the focus (got focus event), if the Member ID is empty and the global is valid (not zero), then assign the global to the Member ID field and immediately set the global variable to 0
0
 

Author Closing Comment

by:Reyesrj
ID: 41766162
I'm too new to VBA to understand the suggestions.

This is the only answer given
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 41782137
I made a copy of your form, called frmMembersInfo, with two combo box record selectors in the header, one for selecting by Member ID, and the other for selecting by name.  This will work, as far as selecting members is concerned, but a lot more work is needed, started with normalizing the tables and setting up appropriate relationships.  I gave the form a record source of just tblMembers, but that means that some controls lack record sources.  The normalization should be done first, before fixing that problem.
HBF-Modified-DataEntry.accdb
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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