Solved

MS Access

Posted on 2016-08-16
5
74 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
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 500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

827 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