A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Populate Form and subForms based on the user's selection from acombo box



 
 
Thread Tools Display Modes
  #11  
Old January 21st, 2010, 12:50 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Populate Form and subForms based on the user's selection from a combo box

On Wed, 20 Jan 2010 15:44:25 -0800 (PST), Frank wrote:


I created the VB code similar to the code you suggested in combo box
(see code below), But it does not work. When an employee name is
selected from combox box, the form and subforms are not refreshed.

Frank


Private Sub Select_Employee_AfterUpdate()

Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "Employee = """ & Me!Select_Employee & """"
If rs.NoMatch Then
MsgBox "Something wrong, employee not found!"
Else
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End Sub




Is Employee a Lookup field? If so, it's stored in the table as a numeric ID.
What is the datatype of EMPLOYEE in the table? What's on its lookup tab? Do
you in fact have just a full name in the field (that's unwise, you should have
separate fields for last and first names)? What (if anything) is the Primary
Key of the employee table?
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.