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!

Use value from listbox to go to record 1

Status
Not open for further replies.

Niebotel

Programmer
Jan 1, 2007
169
NL
I have a form with a listbox on it. The Listbox contains 3 fields. I want to use the second field for directly jumping the form to the record which contains this value. I cannot get it running;
Please help; the wizard which actually should arrange this in standard Access is not available (i do not know why)
 
Have a look at the Column property of your ListBox

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Please give some more info; Im struggeling already for hours!
 
Im struggeling already for hours
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I tried:
With Forms!facturenArchief.RecordsetClone
.FindFirst "ID = " & Me.ZoekZoek.Column(4)
End With

Tells me types mismatch
If I debug the value Me.ZoekZoek.column(4) contains the right value but ...

I tried simular code with Docmd.gotorecord



 
If ID isn't numeric:
Code:
.FindFirst "ID=[!]'[/!]" & Me!ZoekZoek.Column(4) [!]& "'"[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
.FindFirst "ID = " & Me.ZoekZoek.Column(4)
Gives arror: 3077 Syntax error : operator missing

.FindFirst "ID='" & Me!ZoekZoek.Column(4) & "'"
Gives error 3464: Type mismatch

Hope you want to help me once again
 
If I debug the value Me.ZoekZoek.column(4) contains the right value
Which value ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
It contains the value of the the field ID in the listbox.
I have 4 fields in the listbox; the 4th is the field ID.

I want to jump to the record with that ID.
ID is the primery key
 
the [!]4[/!]th is the field ID
.FindFirst "ID = " & Me.ZoekZoek.Column([!]3[/!])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top