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. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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 | |
|
|