Click to See Complete Forum and Search --> : Need Help tonight


February 14th, 2000, 11:24 PM
I have a program where I want to search for either an employee id, last name or state. Doing that is not the problem, what I want to know is if the search results can be displayed in a datagrid. If not, I know I can make the results display in a listbox, but I would then need to pass the selected listbox index to the form. I have a search set up now that will search through the recordset and and display the first record matching the search criteria in the controls on the form, but if there are more than 1 record that matches the search criteria, the user can not view the results of the second record found and on. Could sombody please help me, my assignment is due on Wednesday, February 16,2000. Thanks in advance

IanPye
February 15th, 2000, 04:08 AM
Hi,

Do you know what type of grid you are going to use? I use MSFlexGrid with the following code

'Setup Your Database Connection and query Here


MSFlexGrid1.Clear 'Clear Old grid and Specify new grid settings
MSFlexGrid1.Rows = 1
MSFlexGrid1.Cols = 2
MSFlexGrid1.TextMatrix(0, 0) = "Field One"
MSFlexGrid1.TextMatrix(0, 1) = "Field Two"

While RS_MYTABLE.EOF = false
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1 ' Add a new Row to the Grid
MSFlexGrid1.TextMatrix(MSFlexGrid1.Rows, 0) = RS_MYTABLE.Fields("Field1").Value 'Specify value for col 1
MSFlexGrid1.TextMatrix(MSFlexGrid1.Rows, 1) = RS_MYTABLE.Fields("Field2").Value 'Specify value for col 2
RS_MYTABLE.MoveNext
Wend



Hope that helps

Ian