listbox question

Matrix_zero

Registered User.
Local time
Today, 00:08
Joined
Jan 26, 2005
Messages
64
Is there a way i can say:


onclick
go to the row i have clicked on in a listbox (whcih may be the top row, or any other row) and put the 3rd colum in that row into a variable
 
You can open a form at the row you selected in the list box. By doing this:

DoCmd.OpenForm "FORM_NAME", , , "[PK_OF_TABLE_TO_FIND_RECORD_IN] = " & Me.LISTBOX_NAME

As for referencing a coloumn in the list box, and saving that into a variable, I dont know.

I need to do a similar thing.

I need to be able to reference a column in the listbox, so that I can use it in the where condition of my DoCmd.OpenForm.

Like this:

DoCmd.OpenForm "FORM_NAME", , , "[PK_OF_TABLE_TO_FIND_RECORD_IN] = " & Me.LISTBOX_NAME & " AND [COLUMN_OF_TABLE] = " & COLUMN_3_OF_LISTBOX.


Can anyone help please?
 
Chunk,

DoCmd.OpenForm "FORM_NAME", , , "[PK_OF_TABLE_TO_FIND_RECORD_IN] = " & Me.LISTBOX_NAME.Column(3)

The index starts at 0.

Wayne
 
WayneRyan said:
Chunk,

DoCmd.OpenForm "FORM_NAME", , , "[PK_OF_TABLE_TO_FIND_RECORD_IN] = " & Me.LISTBOX_NAME.Column(3)

The index starts at 0.

Wayne

Great thanks. Ill give that a try. :)
 

Users who are viewing this thread

Back
Top Bottom