Results 1 to 5 of 5

Thread: data report

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2004
    Posts
    58

    data report

    Hello
    I want to have a program in VB 6 that has a listbox that is filled from an Access db among other controls. I want to be able to pull up a data report based on what is selected in the listbox or the record currently being viewed whichever is easier. I can pull up my data report just fine but there are several clients each having their own data report and they are all in one long report that is basically the same report repeated several times with info particular to each client. I hope that makes sense.

    What I would like is to pull up individual reports and have the report pull up that corresponds to the client that is in the listbox. I don't want the report pulled up by clicking on the list box but rather when the user clicks a button. I used this successfully in another program. But don't want to prompt the user for input but rather just click a button and pull up the report for the record that is being viewed.


    Private Sub ModuleReport_Click()
    If demoduleReport.rsCommand1.State = adStateOpen Then
    demoduleReport.rsCommand1.Close
    End IF

    moduleSN = InputBox("Select a module serial number to view a report on it", "Module Report")
    If moduleSN <> "" Then
    demoduleReport.Command1 moduleSN I think the change is needed here.
    ModuleReport.Show
    ModuleReport.WindowState = 2
    ElseIf moduleSN = "" Then
    MsgBox "You haven't entered a valid number", _
    vbCritical, "Invalid number"
    End If
    End Sub


    If I have a list box called lstClient I suppose I need to somehow reference the listindex.

    thanks for any help!
    Steve

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: data report

    Quote Originally Posted by KinkyWiz
    If I have a list box called lstClient I suppose I need to somehow reference the listindex.
    Is this what you mean?
    VB Code:
    1. lstClients.List(lstClients.ListIndex)

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: data report

    VB Code:
    1. Private Sub Command1_Click()
    2. If DataEnvironment1.rsParticular_Emp.State = 1 Then DataEnvironment1.rsParticular_Emp.Close
    3. DataEnvironment1.Particular_Emp (Val(CECODE.Text))
    4. Particular_Emp.Show
    5. 'DataEnvironment1.rsParticular_Emp.Close
    6. End Sub

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2004
    Posts
    58

    Re: data report

    Thanks for the reply
    this looks interesting...
    VB Code:
    1. Private Sub Command1_Click()
    2.    If DataEnvironment1.rsParticular_Emp.State = 1 Then
    3.    DataEnvironment1.rsParticular_Emp.Close
    4.    DataEnvironment1.Particular_Emp (Val(CECODE.Text))
    5.    Particular_Emp.Show
    6. End Sub
    what is this...
    VB Code:
    1. (Val(CECODE.Text))
    and was rsParticular_Emp formerly rsCommand1 and you renamed it?

    Steve

  5. #5

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