?
Solved

MS Access

Posted on 2016-08-16
5
Medium Priority
?
79 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

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

765 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