Dlookup problems

BenSteckler

Addicted to Programming
Local time
Today, 21:23
Joined
Oct 4, 2000
Messages
44
I am having problems using the Dlookup function.

I have a table called "tbl: Employee Data" with the a field called "Employee Name" and another one called "Ext" (along alot more.)

I want to take a new form, Choose the employee name from a list box and then have the "On Click" function run the dlookup function to fill in the Ext text box on the form.

But I keep getting errors. Does anyone have any ideas?

Thanks
Ben
 
Can I clarify what you are trying to achieve,
you want to select a persons name from a list box and have the "Ext" field filled automatically with the persons ext.

Why don't you build a query based on your employee data table and in the criteria for the employee name enter a reference to the list box e.g.MyNewForm!List0.
To reference the list properly-
Right click when in the criteria row you will get a build option use this to navigate to the relevant list box.

Hope this helps

Ian
 
Or you could create a Combo box on your form using the Wizard and select the third item on the first screen of the Wizard to "Find a record....". When you select the employee the Ext text box will display the data for that employee. The form must be based on the Employee table and then the Combo box created.
 
This might help, it helped me. It was a reply posted my someone named musicmaker:

Put in VB code


Private Sub Inv__AfterUpdate()

Me.Description = Me.Inv_.Column(1)
Me.Brand = Me.Inv_.Column(2)
Me.Model = Me.Inv_.Column(3)

End Sub

But you must first create a combo box that contains the information that you want to looked up.

Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom