Search Using Dropdown

I

Irwin109

Why is it that whenever I make something new a horrible horrible error comes
up?!

Ok, here's my problem this time:

I have a dropdown box with Carer's Names in it is done so it shows the
surname once selected and in the dropdown selection it shows Surname,
Forename (in that order.

Now, I'm trying to do DoCmd.FindRecord function in VBA but I've written
DoCmd.FindRecord (Me.CarerDrpDown.Value) and it keeps coming up with an error
as it is looking at the forename and not surname, how do I get it to look at
the surname without removing the forename from the dropdown box?
 
D

Dorian

If you have multiple columns in your combo box, you need to refer to them as
controlname.column(n) where n is 0 for the first column.
If you have surname and forename concatenated into one column then its a
little tricker since you will need to separate them out either in the query
that concatenates them or in your VB code.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
I

Irwin109

Ah yes, this was great help, might try and use a Dim or something similar,
thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top