Click to See Complete Forum and Search --> : Creation of user controls


Shantshri
June 3rd, 1999, 12:46 AM
We are creating a user control
In general in every application we need to create an interface such as in one text box user will enter code such as customer code if he enters valid customer code then customer name should appear in another text box
We also provide the command button to list the customer name incase user does not know the customer code

Ultimate is not to allow the user to enter invalid customer code
If enter the valid code then display respective name
Provide a button by which he can get the help for list of customer

Question :
To select or validate the enter code we need to connect to database presently we are establishing new connection in control useing RDO
If we wanted to pass a connection in to object as a property
We got an error "Object veriable is not set "
Please Suggest A way by which we can pass connection in to User control Or Dll
Using property or any other way
so that control can use the same connection establish by perent application

Crazy D
June 3rd, 1999, 05:22 PM
Hi

haven't testen it, but try something like
usercontrol:
Public Sub SetConnection(pConnection as rdoConnection)
Set m_Connection = pConnection
End Sub
(don't forget to Set m_Connection = Nothing when you're done...)
and call it simply like
MyControl.SetConnection TheConnectionInTheForm

Hope this works... :-)

Crazy D :-)