Solved

MS Access

Posted on 2016-08-16
5
66 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
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
I'm too new to VBA to understand the suggestions.

This is the only answer given
0
 
LVL 31

Expert Comment

by:Helen_Feddema
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now