Results 1 to 3 of 3

Thread: DataGrid/Recordset problem

  1. #1
    Blue_Jazz
    Guest
    Okay, I am going nuts trying to figure this out. I am somewhat of an intermediate VB programmer and I have no idea where to go about figuring out this problem. I am writing a helpdesk database type app and I ran into a problem. I have a form with a datagrid on it. The datagrid is populated by data from an MS Access database. This datagrid is somewhat of a "directory" listing of calls that are logged into the "helpdesk database" . The list just contains, ContactID, LastName, FirstName, and date of contact fields. I want the user to be able to click a specific record in the datagrid and a form for that specific record to pop up containing the ENTIRE record for that call. Any ideas would be greatly appreciated.

    Thanks

  2. #2
    Hyperactive Member
    Join Date
    Mar 2001
    Location
    Calgary, Canada
    Posts
    453
    Is ContactID unique? If not, make sure that each record has a unique identifier. This can be a GUID or an incrementing number. On your grid, create a hidden column. Put this unique identifier into this hidden colum when you populate the grid.

    Then when the user clicks on the grid line, get the unique identifier. Use this to go to the database and retrieve the information you want.

    Another thing, Try not to use databound controls, but create and populate recordsets within your code. This sort of thing becomes much easier when you are manipulating the data internally.


    I hope this is of some help,

    SD
    "I'd rather have a full bottle in front of me than a full frontal lobotomy!"

  3. #3
    Hyperactive Member
    Join Date
    Mar 2001
    Location
    Calgary, Canada
    Posts
    453
    If your problem is passing the information to the pop-up form, then create a new subroutine in the pop-up form.

    Code:
    Public Sub OpenForm(ByVal strUID As String)
        '// Query database to get data for record strUID
    .
    .
    .
        Me.Show
    End Sub
    Instead of calling the form .show event call the .OpenForm event passing in the unique identifier.

    Cheers,

    SD
    "I'd rather have a full bottle in front of me than a full frontal lobotomy!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width