Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 105,406 VB Programmers for FREE! Ask your question and get quick answers from experts. There are 1,776 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



UFL in VB6 to Crystal reports 10

 
Reply to this topicStart new topic

UFL in VB6 to Crystal reports 10

maldita0616
post 2 Jul, 2008 - 06:30 PM
Post #1


New D.I.C Head

*
Joined: 22 Jun, 2008
Posts: 3

the codes below i used to connect to the database and to populate the combobox which is to be called in crystal as aparameter:

Option Explicit
Private WithEvents conn1 As ADODB.Connection
Private com1 As ADODB.Command
Private WithEvents rsUser As ADODB.Recordset
Private Sub Form_Load()
Set conn1 = New ADODB.Connection
Dim sConnect As String
Set conn1 = New ADODB.Connection
'CRViewer1.Visible = False

sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= C:\MyProg\Data\DB3.mdb;"
conn1.CursorLocation = adUseClient
conn1.Open sConnect
Set com1 = New ADODB.Command
Set rsUser = New ADODB.Recordset
rsUser.CursorType = adOpenStatic
rsUser.LockType = adLockOptimistic
rsUser.Source = "Select UserID From Users Where IsOfficer = YES"
Set rsUser.ActiveConnection = conn1
rsUser.Open
Showusers
End Sub

Public Function Showusers() As String
Combo1.Clear
rsUser.Requery
rsUser.MoveFirst
Do Until rsUser.EOF
Combo1.AddItem rsUser!UserID
rsUser.MoveNext
Loop
End Function

the codes below is used to create the UFL

Option Explicit
Public Function showuser() As String
Dim x As Long
x = Shell(App.Path & "\crUFLfrm1.exe", vbNormalFocus)
End Function

Private Sub Class_Initialize()
showuser
End Sub

i already added the crUFLcbo to crystal the probem is everytime i start crystal the combo box appears. it shouldnt behave that way. it should be displayed only if i run the premiums report as a parameter. once the user clicks one value in the combo box it calls the data in the database and returns all the member under the selected user. help anyone, i dont know how to call it in crystal properly.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/20/08 05:14AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month