I am trying to create a form where the user selects the distinct first letter of the last names from a list box.
SELECT DISTINCT [qryMem].[LETTER] FROM qryMem;
Then from a list box containing the distinct last names;
SELECT DISTINCT [qryMem].[LAST_NAME], [qryMem].[LETTER] FROM qryMem WHERE ((([qryMem].[LETTER]) Like [Forms]![SearchFormByLetter]![lstLetter]));
The final (third) list box presents the first names and the member ID’s to the user. The member ID’s are required since there are several duplications of first and last names in the database and a method is required to distinguish them.
SELECT [qryMem].[FIRST_NAME] & ' - ' & [qryMem].[MEM_ID] FROM qryMem WHERE ((([qryMem].[LAST_NAME])=[Forms]![SearchFormByLetter]![lstLastName])) ORDER BY [qryMem].[FIRST_NAME];
So far, kit seems to work just fine.
Now I am trying to update the record which lives on the same form as the list boxes. Here is the code that I have that lives in the “After Update” of the lstFirstName list box, however I haven’t been able to figure out the syntax. Because I have both a “MemId” field and a “FIRST_NAME”. in the final list box
Private Sub lstFirstName_AfterUpdate()
'Want it to move to MemID text box and
'find the record of whatever “MemID” is selected in the combo box
DoCmd.ShowAllRecords
Me!txtMemID.SetFocus
DoCmd.FindRecord Me!lstFirstName
End Sub
This is a project that I worked on a few years ago for a church membership and it was abandoned. I haven’t touched it or any other Access projects since. I suspect that the solution is evident, however it seems that about 99% of what I knew about MS Access has slipped away from me and I would like to get it back! Thank heaven for folks like you.
I have browsed through the forums and haven’t found anything that is obviously like I am trying to accomplish, and I am feeling like I am in way over my head (as usual).
I hope that I have made this clear enough. Any suggestions would be appreciated.
Ray
SELECT DISTINCT [qryMem].[LETTER] FROM qryMem;
Then from a list box containing the distinct last names;
SELECT DISTINCT [qryMem].[LAST_NAME], [qryMem].[LETTER] FROM qryMem WHERE ((([qryMem].[LETTER]) Like [Forms]![SearchFormByLetter]![lstLetter]));
The final (third) list box presents the first names and the member ID’s to the user. The member ID’s are required since there are several duplications of first and last names in the database and a method is required to distinguish them.
SELECT [qryMem].[FIRST_NAME] & ' - ' & [qryMem].[MEM_ID] FROM qryMem WHERE ((([qryMem].[LAST_NAME])=[Forms]![SearchFormByLetter]![lstLastName])) ORDER BY [qryMem].[FIRST_NAME];
So far, kit seems to work just fine.
Now I am trying to update the record which lives on the same form as the list boxes. Here is the code that I have that lives in the “After Update” of the lstFirstName list box, however I haven’t been able to figure out the syntax. Because I have both a “MemId” field and a “FIRST_NAME”. in the final list box
Private Sub lstFirstName_AfterUpdate()
'Want it to move to MemID text box and
'find the record of whatever “MemID” is selected in the combo box
DoCmd.ShowAllRecords
Me!txtMemID.SetFocus
DoCmd.FindRecord Me!lstFirstName
End Sub
This is a project that I worked on a few years ago for a church membership and it was abandoned. I haven’t touched it or any other Access projects since. I suspect that the solution is evident, however it seems that about 99% of what I knew about MS Access has slipped away from me and I would like to get it back! Thank heaven for folks like you.
I have browsed through the forums and haven’t found anything that is obviously like I am trying to accomplish, and I am feeling like I am in way over my head (as usual).
I hope that I have made this clear enough. Any suggestions would be appreciated.
Ray