Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!!!!!!!!!!!!!!!!!!!!!!!!911

Status
Not open for further replies.

jdwm2310

Technical User
Jul 26, 2001
396
US
Hi,

I have a combo box with employee names. I want to click on a specific name and see the record of that specific person.

I created a code but it doesn't seem to work.

what should I do?
 
Hi!

Without seeing your code, I couldn't say why it didn't work. But code that should work follows:

DoCmd.OpenForm "FormName", , , "EmployeeName = '" & NameTextBox.Text & "'"

Of course, you will need to use your specific names for the controls, forms and fields. Please note that it is important to use the .Text in this situation since the value is not updated until the control loses focus.

hth
Jeff Bridgham
 
you can also do this using a macro..you would need a primary key..eg..id#..

in macro state the following

go to control = id
find record = combobox#..put this under find what.
go to control combobox#

this should work


DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
Hi :)

The third method could be use of subform. Place a subform with fields u want to show on the record and set it criteria in query expression as

select f1,f2,f3 from mytable where f1=Forms![MyForm]![MyCombo];

Now on update event of that combo just write

doCmd.Requery "MySubForm"

Hope it'll increase ur insight

Cheers
Aqif

 
jebry

I get a run time error 2185

I inserted the code as follow:
Private Sub Employee_Data_Click()

DoCmd.OpenForm "SERP DATA", , , "Employee Data = '" & Text181.Text & "'"

End Sub
 
This was the code I used:

DoCmd.GoToRecord ([acActiveDataObject],[Object Name=SERP DATA],[Record as AcRecord=acGoTo],[Offset])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top